@@ -112,7 +112,7 @@ cli_upload_usage() {
112112 echo
113113
114114 printf " Usage:\n"
115- printf " cli upload SOURCE [options] \n"
115+ printf " cli upload FILES... \n"
116116 printf " cli upload --help | -h\n"
117117 echo
118118
@@ -122,22 +122,12 @@ cli_upload_usage() {
122122 echo " --help, -h"
123123 printf " Show this help\n"
124124 echo
125- # :command.usage_flags
126- # :flag.usage
127- echo " --user, -u USER (required)"
128- printf " Username to use for logging in\n"
129- echo
130-
131- # :flag.usage
132- echo " --password, -p PASSWORD"
133- printf " Password to use for logging in\n"
134- echo
125+
135126 # :command.usage_args
136127 printf " Arguments:\n"
137128
138- # :argument.usage
139- echo " SOURCE"
140- printf " File to upload\n"
129+ echo " FILES..."
130+ printf " Files to upload\n"
141131 echo
142132
143133 fi
@@ -340,67 +330,30 @@ cli_upload_parse_requirements() {
340330 # :command.command_filter
341331 action=" upload"
342332 # :command.required_args_filter
343- if [[ $1 && $1 != -* ]]; then
344- args[source]=$1
345- shift
346- else
347- printf " missing required argument: SOURCE\nusage: cli upload SOURCE [options]\n"
348- exit 1
349- fi
350333 # :command.required_flags_filter
351- argstring=" $* "
352- if [[ " $argstring " != * --user* && " $argstring " != * -u* ]]; then
353- printf " missing required flag: --user, -u USER\n"
354- exit 1
355- fi
356334 # :command.parse_requirements_while
357335 while [[ $# -gt 0 ]]; do
358336 key=" $1 "
359337 case " $key " in
360- # :flag.case
361- --user | -u )
362- if [[ $2 ]]; then
363- args[--user]=" $2 "
364- shift
365- shift
366- else
367- printf " %s\n" " --user requires an argument: --user, -u USER"
368- exit 1
369- fi
370- ;;
371-
372- # :flag.case
373- --password | -p )
374- if [[ $2 ]]; then
375- args[--password]=" $2 "
376- shift
377- shift
378- else
379- printf " %s\n" " --password requires an argument: --password, -p PASSWORD"
380- exit 1
381- fi
382- ;;
383-
384338
385339 -* )
386- printf " invalid option: %s\n " " $key "
387- exit 1
340+ other_args+=( " $1 " )
341+ shift
388342 ;;
389343
390344 * )
391345 # :command.parse_requirements_case
392- if [[ ! ${args[source]} ]]; then
393- args[source]=$1
346+ other_args+=(" $1 " )
394347 shift
395- else
396- printf " invalid argument: %s\n" " $key "
397- exit 1
398- fi
399348 ;;
400349
401350 esac
402351 done
403352 # :command.catch_all_filter
353+ if [[ ${# other_args[@]} -eq 0 ]]; then
354+ printf " missing required argument: FILES...\nusage: cli upload FILES...\n"
355+ exit 1
356+ fi
404357 # :command.default_assignments
405358 # :command.whitelist_filter
406359}
0 commit comments