diff --git a/README.md b/README.md index 512edebd..37dcede4 100644 --- a/README.md +++ b/README.md @@ -133,7 +133,7 @@ Define a positional argument. ### @option ``` -@option [short] [modifier|default|modifier+choices] [value-notation]... [help-string] +@option [short] [modifier|default|modifier+choices] [value-notations] [help-string] ``` Define a option. @@ -143,20 +143,21 @@ Define a option. # @option -b --ob short # @option -c short only # @option --oc! required -# @option --od* multiple -# @option --oe+ required + multiple +# @option --od* multi-occurs +# @option --oe+ required + multi-occurs # @option --ona value notation -# @option --onb multiple value notations +# @option --onb two-args value notations +# @option --onc unlimited-args value notations # @option --oda=a default # @option --odb=`_default_fn` default from fn # @option --oca[a|b] choice # @option --ocb[=a|b] choice + default -# @option --occ*[a|b] multiple + choice -# @option --ocd+[a|b] required + multiple + choice +# @option --occ*[a|b] multi-occurs + choice +# @option --ocd+[a|b] required + multi-occurs + choice # @option --ofa[`_choice_fn`] choice from fn # @option --ofb[?`_choice_fn`] choice from fn + no validation -# @option --ofc*[`_choice_fn`] multiple + choice from fn -# @option --ox~ capture all remaing args +# @option --ofc*[`_choice_fn`] multi-occurs + choice from fn +# @option --oxa~ capture all remaing args ``` ### @flag @@ -172,8 +173,8 @@ Define a flag. A flag is an option of boolean type, and is always false by defau # @flag --fa # @flag -b --fb shoft # @flag -c shoft only -# @flag --fd* multiple -# @flag -e --fe* short + multiple +# @flag --fd* multi-occurs +# @flag -e --fe* short + multi-occurs ``` ### @alias diff --git a/examples/options.sh b/examples/options.sh index 325ef234..4a708e5d 100755 --- a/examples/options.sh +++ b/examples/options.sh @@ -4,20 +4,21 @@ # @option -b --ob short # @option -c short only # @option --oc! required -# @option --od* multiple -# @option --oe+ required + multiple +# @option --od* multi-occurs +# @option --oe+ required + multi-occurs # @option --ona value notation -# @option --onb multiple value notations +# @option --onb two-args value notations +# @option --onc unlimited-args value notations # @option --oda=a default # @option --odb=`_default_fn` default from fn # @option --oca[a|b] choice # @option --ocb[=a|b] choice + default -# @option --occ*[a|b] multiple + choice -# @option --ocd+[a|b] required + multiple + choice +# @option --occ*[a|b] multi-occurs + choice +# @option --ocd+[a|b] required + multi-occurs + choice # @option --ofa[`_choice_fn`] choice from fn # @option --ofb[?`_choice_fn`] choice from fn + no validation -# @option --ofc*[`_choice_fn`] multiple + choice from fn -# @option --ox~ capture all remaing args +# @option --ofc*[`_choice_fn`] multi-occurs + choice from fn +# @option --oxa~ capture all remaing args options() { :; } @@ -27,8 +28,8 @@ options() { # @flag --fa # @flag -b --fb shoft # @flag -c shoft only -# @flag --fd* multiple -# @flag -e --fe* short + multiple +# @flag --fd* multi-occurs +# @flag -e --fe* short + multi-occurs flags() { :; } diff --git a/src/bin/argc/main.rs b/src/bin/argc/main.rs index 7b6b1894..d2c73beb 100644 --- a/src/bin/argc/main.rs +++ b/src/bin/argc/main.rs @@ -88,14 +88,14 @@ fn run() -> Result { "--argc-completions" => { let shell: Shell = match args.get(2) { Some(v) => v.parse()?, - None => bail!("Usage: argc --argc-completions [CMDS...]"), + None => bail!("Usage: argc --argc-completions [CMDS]..."), }; let script = crate::completions::generate(shell, &args[3..])?; println!("{}", script); } "--argc-parallel" => { if args.len() <= 3 { - bail!("Usage: argc --argc-parallel