Optparsing: add other commands

Now all commands should have been ported
This commit is contained in:
boyska 2011-07-19 15:42:49 +02:00
parent c71bd81af2
commit 89d4b8d8d0

View File

@ -1067,13 +1067,24 @@ EOF
} }
main () { main () {
main_opts=(q -quiet=q D -debug=D h -help=h v -verbose=v) typeset -A subcommands_opts
typeset -A subcommands_opts ### Options configuration
subcommands_opts[open]="n -nohook=n k: -key=k o: -mount-options=o" main_opts=(q -quiet=q D -debug=D h -help=h v -verbose=v)
subcommands_opts[create]="s: -size=s" subcommands_opts[open]="n -nohook=n k: -key=k o: -mount-options=o"
subcommands_opts[close]="" subcommand_opts[mount]=subcommand_opts[open]
subcommands_opts[help]="" subcommands_opts[create]="s: -size=s"
subcommands_opts[close]=""
subcommands_opts[help]=""
subcommand_opts[slam]=""
subcommand_opts[list]=""
subcommand_opts[help]=""
subcommand_opts[bury]=""
subcommand_opts[exhume]=""
subcommand_opts[decompose]=""
subcommand_opts[recompose]=""
subcommand_opts[install]=""
subcommand_opts[askpass]=""
subcommand_opts[mktemp]=""
### Parsing global options (wherever they are) ### Parsing global options (wherever they are)
zparseopts -M -E -D -Aglobal_opts $main_opts zparseopts -M -E -D -Aglobal_opts $main_opts
if [[ -n ${(k)global_opts[-h]} ]]; then # -h is set if [[ -n ${(k)global_opts[-h]} ]]; then # -h is set