You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ To use, call `init_command_line_parser()` to initialize the parsing tool. Then c
13
13
14
14
Given a command line such as `Rscript MyCheckbook.R withdraw cash --amount=100 --msg='birthday gift'`, `withdraw` is the command, `cash` is a subcommand and `--amount=100` and `--msg='birthday gift'` are arguments. You might also add a `deposit` command, and a `check` subcommand, eg `MyCheckbook.R withdraw check --number=123 --amount=50 --payee='Electric Co.'` to log a check to the electric company.)
15
15
16
-
Note that the user need not provide all registered arguments on the command line. The default parameter passed to `reg_argument_list()` preloads the default. Thus, you could have an argument whose default value is FALSE. When `parse_command_line()` is called, the variable will be set to FALSE, unless the user includes in the command line, in which case it flips to TRUE.
16
+
Note that the user need not provide all registered arguments on the command line. The default parameter passed to `reg_argument_list()` preloads the default.
17
17
18
18
When registering arguments, you must indicate the type of value you expect to receive. Valid parameter types are:
19
19
-`argsType$TypeBool` for Boolean values. Using the argument flips the default value. Thus, if the default value of `--plot` is `FALSE`, including `--plot` on the command line will set its value to `TRUE`. Arguments of the form `--plot=TRUE` and `--plot=F` are also allowed.
@@ -43,15 +43,18 @@ The file `test_cmdparseR.R` provides a simple example:
0 commit comments