Added documentation for the new -args(0) option.#890
Added documentation for the new -args(0) option.#890gasche merged 3 commits intoocaml:trunkfrom bschommer:args-manual
Conversation
Additionally typos in the documenation of Args.read_arg(0) and Args.write_arg(0) are fixed.
dra27
left a comment
There was a problem hiding this comment.
Large number of comments, but predominantly it's just missing hyphens!
manual/manual/cmds/comp.etex
Outdated
| interactively. | ||
|
|
||
| \item["-args" \var{filename}] | ||
| Read additional newline separated command line arguments from \var{filename}. |
There was a problem hiding this comment.
newline-separated (hyphenated). Is this sensitive to Unix/Windows line-endings?
manual/manual/cmds/comp.etex
Outdated
| Read additional newline separated command line arguments from \var{filename}. | ||
|
|
||
| \item["-args0" \var{filename}] | ||
| Read additional NUL separated command line arguments from \var{filename}. |
There was a problem hiding this comment.
NUL-separated (as above). Similarly, is there any Unix/Windows line-ending conversion to worry about here (e.g. would the input file foo\r\n\0bar\r\n be read as foo\n\0bar\n\0 on Windows?)
|
|
||
| \item["-args0" \var{filename}] | ||
| Read additional NUL separated command line arguments from \var{filename}. | ||
|
|
|
|
||
| \item["-args0" \var{filename}] | ||
| Read additional NUL separated command line arguments from \var{filename}. | ||
|
|
|
|
||
| \item["-args0" \var{filename}] | ||
| Read additional NUL separated command line arguments from \var{filename}. | ||
|
|
stdlib/arg.mli
Outdated
| @@ -186,12 +186,12 @@ val read_arg: string -> string array | |||
|
|
|||
| val read_arg0: string -> string array | |||
| (** Identical to {!Arg.read_arg} but assumes NUL terminated command line | |||
There was a problem hiding this comment.
I know it's not part of this diff, but this should really be NUL-terminated (however, the manual and the docs are very inconsistent about null/NULL/NUL!)
stdlib/arg.mli
Outdated
| arguments. *) | ||
|
|
||
| val write_arg: string -> string array -> unit | ||
| (** [Arg.write_arg file args] writes the arguments [args] newline terminated |
There was a problem hiding this comment.
And another hyphen for newline-terminated 😄
stdlib/arg.mli
Outdated
| (** [Arg.write_arg file args] writes the arguments [args] newline terminated | ||
| into the file [file]. If the any of the arguments in [args] contains a | ||
| newline use the function {!Args.write_arg0} instead *) | ||
| newline use the function {!Arg.write_arg0} instead. *) |
There was a problem hiding this comment.
newline, use (add comma). Could possibly drop the words the function?
stdlib/arg.mli
Outdated
|
|
||
| val write_arg0: string -> string array -> unit | ||
| (** Identical to {!Arg.write_arg} but uses NUL as terminator instead *) | ||
| (** Identical to {!Arg.write_arg} but uses NUL as terminator instead. *) |
There was a problem hiding this comment.
as → for the (i.e. "uses NUL as the terminator"). There's a slight inconsistency that the .mli file uses "terminator" where the manual uses "separator".
|
Concerning NUL: I'm afraid few programmers know their ASCII table well enough to know that NUL stands for the character with code 0. For everyone else, it looks like a typo for NULL and is associated with null pointers. The man page for GNU Notice the use of "null character" instead of NUL. Likewise in the man page for xargs, option So, please don't use NUL, it's jargon. Better use "null character", perhaps with a mention that this is the character with code 0. |
|
Despite the non-invasiveness of this patch, it won't be on time for the 4.04 release, so I think we will try to update the manual after the release. I'll create a tag for PRs for which that is relevant. |
|
This feature isn't in 4.04 anyway, I think? |
|
I changed |
Oh indeed, I had forgotten about that. Thanks. |
This is incorrect. The arguments are terminated by newlines or null characters, with the last terminator being optional when its argument is not empty:
If you insist on specifying a separator, then it becomes impossible to put an empty list of arguments in the file (and in that case we'll need to change the code). Maybe we should even go so far as to signal an error when the last argument doesn't have its terminator. |
|
Terminated is now used instead of seperated.
I don't think that is a good idea to enforce this since one tends to forget this easily. |
|
"Be liberal in what you accept, and conservative in what you send" (Postel's law). |
|
It is my understanding that the comments have been taken into account, so I'm going ahead and merging the PR -- thanks! If anyone has more comments, feel free to make them here, we can always update or make a second PR. |
Added documentation for the new -args(0) option.
Additionally typos in the documenation of Args.read_arg(0) and Args.write_arg(0) are fixed.
As requeseted in #843.