@@ -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
@@ -248,6 +238,7 @@ parse_requirements() {
248238
249239 esac
250240 done
241+ # :command.catch_all_filter
251242 # :command.default_assignments
252243 # :command.whitelist_filter
253244}
@@ -313,6 +304,7 @@ cli_download_parse_requirements() {
313304
314305 esac
315306 done
307+ # :command.catch_all_filter
316308 # :command.default_assignments
317309 # :command.whitelist_filter
318310}
@@ -338,66 +330,30 @@ cli_upload_parse_requirements() {
338330 # :command.command_filter
339331 action=" upload"
340332 # :command.required_args_filter
341- if [[ $1 && $1 != -* ]]; then
342- args[source]=$1
343- shift
344- else
345- printf " missing required argument: SOURCE\nusage: cli upload SOURCE [options]\n"
346- exit 1
347- fi
348333 # :command.required_flags_filter
349- argstring=" $* "
350- if [[ " $argstring " != * --user* && " $argstring " != * -u* ]]; then
351- printf " missing required flag: --user, -u USER\n"
352- exit 1
353- fi
354334 # :command.parse_requirements_while
355335 while [[ $# -gt 0 ]]; do
356336 key=" $1 "
357337 case " $key " in
358- # :flag.case
359- --user | -u )
360- if [[ $2 ]]; then
361- args[--user]=" $2 "
362- shift
363- shift
364- else
365- printf " %s\n" " --user requires an argument: --user, -u USER"
366- exit 1
367- fi
368- ;;
369-
370- # :flag.case
371- --password | -p )
372- if [[ $2 ]]; then
373- args[--password]=" $2 "
374- shift
375- shift
376- else
377- printf " %s\n" " --password requires an argument: --password, -p PASSWORD"
378- exit 1
379- fi
380- ;;
381-
382338
383339 -* )
384- printf " invalid option: %s\n " " $key "
385- exit 1
340+ other_args+=( " $1 " )
341+ shift
386342 ;;
387343
388344 * )
389345 # :command.parse_requirements_case
390- if [[ ! ${args[source]} ]]; then
391- args[source]=$1
346+ other_args+=(" $1 " )
392347 shift
393- else
394- printf " invalid argument: %s\n" " $key "
395- exit 1
396- fi
397348 ;;
398349
399350 esac
400351 done
352+ # :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
401357 # :command.default_assignments
402358 # :command.whitelist_filter
403359}
0 commit comments