The opt and inst modules use opt_add_arg() to register command line
arguments with a callback, however they omit the newly-added regex
argument, causing the callbacks not to be called.
This commit fixes the order of arguments passed to opt_add_arg() so
that the command line arguments are registered correctly.
return 1
fi
- opt_add_arg "l" "list" "" 0 "List running instances" _inst_handle_opt
- opt_add_arg "s" "stop" "v" "" "Stop a running instance" _inst_handle_opt
+ opt_add_arg "l" "list" "" 0 "List running instances" '' _inst_handle_opt
+ opt_add_arg "s" "stop" "v" "" "Stop a running instance" '^[0-9]+$' _inst_handle_opt
return 0
}
opt_add_arg "h" "help" "" 0 \
"Print this text" \
+ '' \
opt_print_help
opt_add_arg "v" "verbose" "" 0 \
"Be more verbose" \
+ '' \
log_increase_verbosity
opt_add_arg "q" "quiet" "" 0 \
"Be less verbose" \
+ '' \
log_decrease_verbosity
return 0