follow normal zsh case conventions in some functions

This commit is contained in:
Oliver Kiddle 2017-10-28 00:23:07 +02:00
parent 29ce259ea5
commit 538f2a0287
12 changed files with 353 additions and 382 deletions

View File

@ -38,30 +38,24 @@
# #
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
_afew() { _arguments \
'(- 1 *)-h[display usage information]' \
_arguments -C \ "(-c --classify -l --learn= -t --tag -u --update -U --update-reference -m --move-mails)"{-w,--watch}"[continuously monitor the mailbox for new messages matching the given query]" \
'(- 1 *)'-h"[Show help and exit]" \ "(-c --classify -l --learn= -u --update -U --update-reference -m --move-mails -w --watch)"{-t,--tag}"[run the tag filters]" \
"(-c --classify -l --learn= -t --tag -u --update -U --update-reference -m --move-mails)"{-w,--watch}"[Continuously monitor the mailbox for new messages matching the given query]" \ "(-c --classify -t --tag -u --update -U --update-reference -m --move-mails -w --watch)"{-l,--learn=}"[train category with the messages matching query]" \
"(-c --classify -l --learn= -u --update -U --update-reference -m --move-mails -w --watch)"{-t,--tag}"[Run the tag filters]" \ "(-c --classify -l --learn= -t --tag -U --update-reference -m --move-mails -w --watch)"{-u,--update}"[update the categories (requires no query)]" \
"(-c --classify -t --tag -u --update -U --update-reference -m --move-mails -w --watch)"{-l,--learn=}"[Train category with the messages matching query]" \ "(-c --classify -l --learn= -t --tag -u --update -m --move-mails -w --watch)"{-U,--update-reference}"[update the reference category (takes quite some time) (requires no query)]" \
"(-c --classify -l --learn= -t --tag -U --update-reference -m --move-mails -w --watch)"{-u,--update}"[Update the categories (requires no query)]" \ "(-l --learn= -t --tag -u --update -U --update-reference -m --move-mails -w --watch)"{-c,--classify}"[classify each message matching the iven query]" \
"(-c --classify -l --learn= -t --tag -u --update -m --move-mails -w --watch)"{-U,--update-reference}"[Update the reference category (takes quite some time) (requires no query)]" \ "(-c --classify -l --learn= -t --tag -u --update -U --update-reference -w --watch)"{-m,--move-mails}"[move mail files between maildir folders]" \
"(-l --learn= -t --tag -u --update -U --update-reference -m --move-mails -w --watch)"{-c,--classify}"[Classify each message matching the iven query]" \ "(-n --all)"{-a,--all}"[operate on all email]" \
"(-c --classify -l --learn= -t --tag -u --update -U --update-reference -w --watch)"{-m,--move-mails}"[Move mail files between maildir folders]" \ "(-a --new)"{-n,--new}"[operate on all new email]" \
"(-n --all)"{-a,--all}"[Operate on all email]" \ {-C,--notmuch-config=}"[specify path to notmuch configuration file]:files:_files" \
"(-a --new)"{-n,--new}"[Operate on all new email]" \ {-e,--enable-filters=}"[specify filter classes to use]:filter" \
{-C,--notmuch-config=}"[Path to notmuch configuration file]:files:_files" \ {-d,--dry-run}"[don't change the DB]" \
{-e,--enable-filters=}"[Flter classes to use]:filters" \ {-R,--reference-set-size=}"[specify size of the reference set]:size [1000]" \
{-d,--dry-run}"[Dont change the DB]" \ {-T,--reference-set-timeframe-days=}"[don't use emails older than specified age]:age (days) [30]" \
{-R,--reference-set-size=}"[Size of the reference set (default: 1000)]:size:" \ {--verbose,-v}"[be more verbose]" \
{-T,--reference-set-timeframe-days=}"[Do not use emails older than DAYS days (default: 30)]:days:" \ '*: :_guard "^-*" query'
{--verbose,-v}"[Be more verbose]" \
'*:Query:' \
}
_afew
# Local Variables: # Local Variables:
# mode: Shell-Script # mode: Shell-Script

View File

@ -39,9 +39,9 @@
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
local curcontext="$curcontext" state line _packages _opts ret=1 local curcontext="$curcontext" state line _opts ret=1
_arguments -C -A "-v" -A "--version" \ _arguments -C \
'(- 1 *)'{-v,--version}'[display version information]' \ '(- 1 *)'{-v,--version}'[display version information]' \
'1: :->cmds' \ '1: :->cmds' \
'*:: :->args' && ret=0 '*:: :->args' && ret=0
@ -49,35 +49,34 @@ _arguments -C -A "-v" -A "--version" \
case $state in case $state in
cmds) cmds)
_values "bower command" \ _values "bower command" \
"cache[Manage bower cache]" \ "cache[manage bower cache]" \
"help[Display help information about Bower]" \ "help[display help information about Bower]" \
"home[Opens a package homepage into your favorite browser]" \ "home[opens a package homepage into your favorite browser]" \
"info[Info of a particular package]" \ "info[info of a particular package]" \
"init[Interactively create a bower.json file]" \ "init[interactively create a bower.json file]" \
"install[Install a package locally]" \ "install[install a package locally]" \
"link[Symlink a package folder]" \ "link[symlink a package folder]" \
"list[List local packages - and possible updates]" \ "list[list local packages - and possible updates]" \
"login[Authenticate with GitHub and store credentials]" \ "login[authenticate with GitHub and store credentials]" \
"lookup[Look up a package URL by name]" \ "lookup[look up a package URL by name]" \
"prune[Removes local extraneous packages]" \ "prune[removes local extraneous packages]" \
"register[Register a package]" \ "register[register a package]" \
"search[Search for a package by name]" \ "search[search for a package by name]" \
"update[Update a local package]" \ "update[update a local package]" \
"uninstall[Remove a local package]" \ "uninstall[remove a local package]" \
"unregister[Remove a package from the registry]" \ "unregister[remove a package from the registry]" \
"version[Bump a package version]" "version[bump a package version]" && ret=0
_arguments \ _arguments \
'(--force)--force[Makes various commands more forceful]' \ '(--force)--force[make various commands more forceful]' \
'(--json)--json[Output consumable JSON]' \ '(--json)--json[output consumable JSON]' \
'(--log-level)--log-level[What level of logs to report]' \ '(--log-level)--log-level[what level of logs to report]' \
'(--offline)--offline[Do not hit the network]' \ "(--offline)--offline[don't hit the network]" \
'(--quiet)--quiet[Only output important information]' \ '(--quiet)--quiet[only output important information]' \
'(--silent)--silent[Do not output anything, besides errors]' \ "(--silent)--silent[don't output anything, besides errors]" \
'(--verbose)--verbose[Makes output more verbose]' \ '(--verbose)--verbose[make output more verbose]' \
'(--allow-root)--allow-root[Allows running commands as root]' \ '(--allow-root)--allow-root[allow running commands as root]' \
'(--version)--version[Output Bower version]' \ '(--version)--version[output Bower version]' \
'(--no-color)--no-color[Disable colors]' '(--no-color)--no-color[disable colors]' && ret=0
ret=0
;; ;;
args) args)
case $line[1] in case $line[1] in
@ -98,54 +97,46 @@ case $state in
'update' \ 'update' \
'uninstall' \ 'uninstall' \
'unregister' \ 'unregister' \
'version' 'version' && ret=0
ret=0
;; ;;
(home|info|init|link|lookup|prune|register|search|unregister) (home|info|init|link|lookup|prune|register|search|unregister)
_arguments \ _arguments \
'(--help)--help[Show help message]' '(--help)--help[show help message]' && ret=0
ret=0
;; ;;
install) install)
_arguments \ _arguments \
'(--force-latest)--force-latest[Force latest version on conflict]' \ '(--force-latest)--force-latest[force latest version on conflict]' \
'(--help)--help[Show help message]' \ '(--help)--help[show help message]' \
'(--production)--production[Do not install project devDependencies]' \ "(--production)--production[don't install project devDependencies]" \
'(--save)--save[Save installed packages into the project''s bower.json dependencies]' \ "(--save)--save[save installed packages into the project's bower.json dependencies]" \
'(--save-dev)--save-dev[Save installed packages into the project''s bower.json devDependencies]' "(--save-dev)--save-dev[save installed packages into the project's bower.json devDependencies]" && ret=0
ret=0
;; ;;
list) list)
_arguments \ _arguments \
'(--help)--help[Show help message]' \ '(--help)--help[show help message]' \
'(--paths)--paths[Generate a simple JSON source mapping]' \ '(--paths)--paths[generate a simple JSON source mapping]' \
'(--relative)--relative[Make paths relative to the directory config property, which defaults to bower_components]' '(--relative)--relative[make paths relative to the directory config property, which defaults to bower_components]' && ret=0
ret=0
;; ;;
login) login)
_arguments \ _arguments \
'(--help)--help[Show help message]' \ '(--help)--help[show help message]' \
'(-t --token)'{-t,--token}'[Pass GitHub auth token (will not prompt for username/password)]' '(-t --token)'{-t,--token}'[Pass GitHub auth token (will not prompt for username/password)]' && ret=0
ret=0
;; ;;
uninstall) uninstall)
_arguments \ _arguments \
'(--help)--help[Show help message]' \ '(--help)--help[show help message]' \
'(--save)--save[Save installed packages into th projects''s bower.json dependencies]' \ "(--save)--save[save installed packages into the project's bower.json dependencies]" \
'(--save-dev)--save-dev[Save installed packages into th projects''s bower.json devDependencies]' "(--save-dev)--save-dev[save installed packages into the project's bower.json devDependencies]" && ret=0
ret=0
;; ;;
update) update)
_arguments \ _arguments \
'(--force-latest)--force-latest[Force latest version on conflict]' \ '(--force-latest)--force-latest[force latest version on conflict]' \
'(--help)--help[Show help message]' \ '(--help)--help[show help message]' \
'(--production)--production[Do not install project devDependencies]' "(--production)--production[don't install project devDependencies]" && ret=0
ret=0
;; ;;
version) version)
_arguments \ _arguments \
'(--message)--message[Custom git commit and tag message]' '(--message)--message[custom git commit and tag message]' && ret=0
ret=0
;; ;;
exec) exec)
_normal && ret=0 _normal && ret=0
@ -154,7 +145,7 @@ case $state in
_opts=( $(bower help $line[1] | sed -e '/^ \[-/!d; s/^ \[\(-[^=]*\)=.*/\1/') ) _opts=( $(bower help $line[1] | sed -e '/^ \[-/!d; s/^ \[\(-[^=]*\)=.*/\1/') )
_opts+=( $(bower help $line[1] | sed -e '/^ -/!d; s/^ \(-.\), \[\(-[^=]*\)=.*/\1 \2/') ) _opts+=( $(bower help $line[1] | sed -e '/^ -/!d; s/^ \(-.\), \[\(-[^=]*\)=.*/\1 \2/') )
if [[ $_opts != "" ]]; then if [[ $_opts != "" ]]; then
_values 'options' $_opts && ret=0 _values 'option' $_opts && ret=0
fi fi
;; ;;
esac esac

View File

@ -40,54 +40,56 @@
_stack () { _stack () {
_arguments \ _arguments \
--version'[Show version]' \ --version'[display version information]' \
--help'[Show this help text]' \ --help'[display usage information]' \
'--docker*''[Run "stack --docker-help" for details]' \ '--docker*''[run "stack --docker-help" for details]' \
--verbosity'[Verbosity: silent, error, warn, info, debug]' \ --verbosity'[verbosity: silent, error, warn, info, debug]' \
{-v,--verbose}'[Enable verbose mode: verbosity level "debug"]' \ {-v,--verbose}'[enable verbose mode: verbosity level "debug"]' \
--system-ghc'[Enable using the system installed GHC (on the PATH) if available and a matching version]' \ --system-ghc'[enable using the system installed GHC (on the PATH) if available and a matching version]' \
--no-system-ghc'[Disable using the system installed GHC (on the PATH) if available and a matching version]' \ --no-system-ghc'[disable using the system installed GHC (on the PATH) if available and a matching version]' \
--install-ghc'[Enable downloading and installing GHC if necessary (can be done manually with stack setup)]' \ --install-ghc'[enable downloading and installing GHC if necessary (can be done manually with stack setup)]' \
--no-install-ghc'[Disable downloading and installing GHC if necessary (can be done manually with stack setup)]' \ --no-install-ghc'[disable downloading and installing GHC if necessary (can be done manually with stack setup)]' \
--arch'[System architecture, e.g. i386, x86_64]' \ --arch'[system architecture, e.g. i386, x86_64]' \
--os'[Operating system, e.g. linux, windows]' \ --os'[operating system, e.g. linux, windows]' \
{-j,--jobs}'[Number of concurrent jobs to run]' \ {-j,--jobs}'[number of concurrent jobs to run]' \
--extra-include-dirs'[Extra directories to check for C header files]' \ --extra-include-dirs'[extra directories to check for C header files]' \
--extra-lib-dirs'[Extra directories to check for libraries]' \ --extra-lib-dirs'[extra directories to check for libraries]' \
--skip-ghc-check'[Enable skipping the GHC version and architecture check]' \ --skip-ghc-check'[enable skipping the GHC version and architecture check]' \
--no-skip-ghc-check'[Disable skipping the GHC version and architecture check]' \ --no-skip-ghc-check'[disable skipping the GHC version and architecture check]' \
--skip-msys'[Enable skipping the local MSYS installation (Windows only)]' \ --skip-msys'[enable skipping the local MSYS installation (Windows only)]' \
--no-skip-msys'[Disable skipping the local MSYS installation (Windows only)]' \ --no-skip-msys'[disable skipping the local MSYS installation (Windows only)]' \
--resolver'[Override resolver in project file]' \ --resolver'[override resolver in project file]' \
--no-terminal'[Override terminal detection in the case of running in a false terminal]' \ --no-terminal'[override terminal detection in the case of running in a false terminal]' \
--stack-yaml'[Override project stack.yaml file (overrides any STACK_YAML environment variable)]' \ --stack-yaml'[override project stack.yaml file (overrides any STACK_YAML environment variable)]' \
'*: :__stack_modes' '*: :__stack_modes'
} }
__stack_modes () { __stack_modes () {
_values \ _values \
'subcommand' \ 'subcommand' \
'build[Build the project(s) in this directory/configuration]' \ 'build[build the project(s) in this directory/configuration]' \
'install[Build executables and install to a user path]' \ 'install[build executables and install to a user path]' \
'test[Build and test the project(s) in this directory/configuration]' \ 'test[build and test the project(s) in this directory/configuration]' \
'bench[Build and benchmark the project(s) in this directory/configuration]' \ 'bench[build and benchmark the project(s) in this directory/configuration]' \
'haddock[Generate haddocks for the project(s) in this directory/configuration]' \ 'haddock[generate haddocks for the project(s) in this directory/configuration]' \
'new[Create a brand new project]' \ 'new[create a brand new project]' \
'init[Initialize a stack project based on one or more cabal packages]' \ 'init[initialize a stack project based on one or more cabal packages]' \
'solver[Use a dependency solver to try and determine missing extra-deps]' \ 'solver[use a dependency solver to try and determine missing extra-deps]' \
'setup[Get the appropriate ghc for your project]' \ 'setup[get the appropriate ghc for your project]' \
'path[Print out handy path information]' \ 'path[print out handy path information]' \
'unpack[Unpack one or more packages locally]' \ 'unpack[unpack one or more packages locally]' \
'update[Update the package index]' \ 'update[update the package index]' \
'upgrade[Upgrade to the latest stack (experimental)]' \ 'upgrade[upgrade to the latest stack (experimental)]' \
'upload[Upload a package to Hackage]' \ 'upload[upload a package to Hackage]' \
'dot[Visualize your projects dependency graph using Graphviz dot]' \ 'dot[visualize your projects dependency graph using Graphviz dot]' \
'exec[Execute a command]' \ 'exec[execute a command]' \
'ghc[Run ghc]' \ 'ghc[run ghc]' \
'ghci[Run ghci in the context of project(s)]' \ 'ghci[run ghci in the context of project(s)]' \
'ide[Run ide-backend-client with the correct arguments]' \ 'ide[run ide-backend-client with the correct arguments]' \
'runghc[Run runghc]' \ 'runghc[run runghc]' \
'clean[Clean the local packages]' \ 'clean[clean the local packages]' \
'docker[Subcommands specific to Docker use]' 'docker[subcommands specific to Docker use]'
} }
_stack "$@"

View File

@ -39,22 +39,17 @@
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
_subl() { local I="-h --help -v --version"
integer ret=1 local -a args
local I="-h --help -v --version" args+=(
local -a args "(- *)"{-h,--help}'[display usage information]'
args+=( "(- *)"{-v,--version}'[display version information]'
"(- *)"{-h,--help}'[Show help and exit]' "($I)--project[load the given project]:project"
"(- *)"{-v,--version}'[Show version and exit]' "($I)--command[run the given command]:command"
"($I)--project[Load the given project]:project:" "($I -n --new-window)"{-n,--new-window}'[open a new window]'
"($I)--command[Run the given command]:command:" "($I -a --add)"{-a,--add}'[add folders to the current window]'
"($I -n --new-window)"{-n,--new-window}'[Open a new window]' "($I -w --wait)"{-w,--wait}'[wait for the files to be closed before returning]'
"($I -a --add)"{-a,--add}'[Add folders to the current window]' "($I -b --background)"{-b,--background}"[don't activate the application]"
"($I -w --wait)"{-w,--wait}'[Wait for the files to be closed before returning]' )
"($I -b --background)"{-b,--background}'[Do not activate the application]' _arguments "$args[@]" '*:file:_files'
)
_arguments $args[@] '*:file:_files' && ret=0
return ret
}
_subl

View File

@ -39,16 +39,10 @@
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
_trash-list() { _arguments \
'--version[show programs version number and exit]' \
_arguments -C \ {-h,--help}'[show help message and exit]' \
'--version[Show programs version number and exit]' \ '*: :'
{-h,--help}'[Show help message and exit]' \
'*: :' \
}
_trash-list
# Local Variables: # Local Variables:
# mode: Shell-Script # mode: Shell-Script

View File

@ -39,21 +39,15 @@
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
_trash-put() { _arguments -C \
'--version[display version information]' \
_arguments -C \ {-h,--help}'[display usage information]' \
'--version[Show programs version number and exit]' \ {-d,--directory}'[remove empty directories - ignored (for GNU rm compabilty)]' \
{-h,--help}'[Show help message and exit]' \ {-f,--force}'[ignore nonexistent arguments and never prompt - ignored (for GNU rm compabilty)]' \
{-d,--directory}'[Remove empty directories - ignored (for GNU rm compabilty)]' \ {-i,--interactive}'[prompt before every removal - ignored (for GNU rm compabilty)]' \
{-f,--force}'[Ignore nonexistent arguments and never prompt - ignored (for GNU rm compabilty)]' \ {-r,-R,--recursive}'[remove directories and their content recursively - ignored (for GNU rm compabilty)]' \
{-i,--interactive}'[Prompt before every removal - ignored (for GNU rm compabilty)]' \ {-v,--verbose}'[explain what is being done]' \
{-r,-R,--recursive}'[Remove directories and their content recursively - ignored (for GNU rm compabilty)]' \ '*: :_files'
{-v,--verbose}'[Explain what is being done]' \
'*: :_files' \
}
_trash-put
# Local Variables: # Local Variables:
# mode: Shell-Script # mode: Shell-Script

View File

@ -56,7 +56,7 @@ _paths() {
_path_list+=$_path _path_list+=$_path
done done
_describe 'paths' _path_list _describe 'path' _path_list
} }
_filesystems() { _filesystems() {
@ -68,96 +68,97 @@ _filesystems() {
'xenix' 'xfs' 'xiafs' 'xenix' 'xfs' 'xiafs'
) )
_describe 'file system types' _fs_types _describe 'file system type' _fs_types
} }
_udisksctl() { _udisksctl() {
typeset -A opt_args typeset -A opt_args
local curcontext="$curcontext" state line local curcontext="$curcontext" state line ret=1
_arguments -C \ _arguments -C \
'1:udisksctl commands:->cmds' \ '1:udisksctl commands:->cmds' \
'*:: :->cmd_args' \ '*:: :->cmd_args' && ret=0
case $state in case $state in
cmds) cmds)
local commands; commands=( local commands; commands=(
'help: Show help' 'help:show help'
'info: Show info about an object' 'info:show info about an object'
'dump: Show info about all object' 'dump:show info about all object'
'status: Shows high-level status' 'status:shows high-level status'
'monitor: Monitor changes to objects' 'monitor:monitor changes to objects'
'mount: Mount a filesystem' 'mount:mount a filesystem'
'unmount: Unmount a filesystem' 'unmount:unmount a filesystem'
'unlock: Unlock an encrypted device' 'unlock:unlock an encrypted device'
'lock: Lock an encrypted device' 'lock:lock an encrypted device'
'loop-setup: Set-up a loop device' 'loop-setup:set-up a loop device'
'loop-delete: Delete a loop device' 'loop-delete:delete a loop device'
'power-off: Safely power off a drive' 'power-off:safely power off a drive'
'smart-simulate: Set SMART data for a drive' 'smart-simulate:set SMART data for a drive'
) )
_describe -t commands 'udisksctl commands' commands _describe -t commands 'udisksctl command' commands && ret=0
;; ;;
cmd_args) cmd_args)
case $words[1] in case $words[1] in
info) info)
_arguments \ _arguments \
{-p,--object-path}'[Object to get information about]:object path:_paths' \ {-p,--object-path}'[specify object to get information about]:object path:_paths' \
{-b,--block-device}'[Block device to get information about]:block device:_paths' \ {-b,--block-device}'[specify block device to get information about]:block device:_paths' \
{-d,--drive}'[Drive to get information about]:drives:_paths' \ {-d,--drive}'[specify drive to get information about]:drive:_paths' && ret=0
;; ;;
mount) mount)
_arguments \ _arguments \
{-p,--object-path}'[Object to mount]:object path:_paths' \ {-p,--object-path}'[specify object to mount]:object path:_paths' \
{-b,--block-device}'[Block device to mount]:block device:_paths' \ {-b,--block-device}'[specify block device to mount]:block device:_paths' \
{-t,--filesystem-type}'[Filesystem type to use]:fs type:_filesystems' \ {-t,--filesystem-type}'[specify filesystem type to use]:fs type:_filesystems' \
{-o,--options}'[Mount options]' \ {-o,--options}'[mount options]' \
'(--no-user-interaction)--no-user-interaction[Do not authenticate the user if needed]' \ "(--no-user-interaction)--no-user-interaction[don't authenticate the user if needed]" && ret=0
;; ;;
unmount) unmount)
_arguments \ _arguments \
{-p,--object-path}'[Object to unmount]:object path:_paths' \ {-p,--object-path}'[object to unmount]:object path:_paths' \
{-b,--block-device}'[Block device to unmount]:block device:_paths' \ {-b,--block-device}'[block device to unmount]:block device:_paths' \
{-f,--force}'[Force/lazy unmount]' \ {-f,--force}'[force/lazy unmount]' \
'(--no-user-interaction)--no-user-interaction[Do not authenticate the user if needed]' \ "(--no-user-interaction)--no-user-interaction[don't auhenticate the user if needed]" && ret=0
;; ;;
unlock|lock) unlock|lock)
_arguments \ _arguments \
{-p,--object-path}'[Object to lock/unlock]:object path:_paths' \ {-p,--object-path}'[object to lock/unlock]:object path:_paths' \
{-b,--block-device}'[Block device to lock/unlock]:block device:_paths' \ {-b,--block-device}'[block device to lock/unlock]:block device:_paths' \
'(--no-user-interaction)--no-user-interaction[Do not authenticate the user if needed]' \ "(--no-user-interaction)--no-user-interaction[don't authenticate the user if needed]" && ret=0
;; ;;
loop-setup) loop-setup)
_arguments \ _arguments \
{-f,--file}'[File to set-up a loop device for]:files:_files' \ {-f,--file}'[specify file to set-up a loop device for]:files:_files' \
{-r,--read-only}'[Setup read-only device]' \ {-r,--read-only}'[setup read-only device]' \
{-o,--offset}'[Start at <num> bytes into file]:offset in bytes:' \ {-o,--offset}'[start at specified offset into file]:offset (bytes)' \
{-s,--size}'[Limit size to <num> bytes]:limit in bytes:' \ {-s,--size}'[limit size]:limit (bytes)' \
'(--no-user-interaction)--no-user-interaction[Do not authenticate the user if needed]' \ "(--no-user-interaction)--no-user-interaction[don't authenticate the user if needed]" && ret=0
;; ;;
loop-delete) loop-delete)
_arguments \ _arguments \
{-p,--object-path}'[Object for loop device to delete]:object path:_paths' \ {-p,--object-path}'[object for loop device to delete]:object path:_paths' \
{-b,--block-device}'[Loop device to delete]:block device:_paths' \ {-b,--block-device}'[loop device to delete]:block device:_paths' \
'(--no-user-interaction)--no-user-interaction[Do not authenticate the user if needed]' \ "(--no-user-interaction)--no-user-interaction[don't authenticate the user if needed]" && ret=0
;; ;;
power-off) power-off)
_arguments \ _arguments \
{-p,--object-path}'[Object path for ATA device]:object path:_paths' \ {-p,--object-path}'[object path for ATA device]:object path:_paths' \
{-b,--block-device}'[Device file for ATA devic]:block device:_paths' \ {-b,--block-device}'[device file for ATA devic]:block device:_paths' \
'(--no-user-interaction)--no-user-interaction[Do not authenticate the user if needed]' \ "(--no-user-interaction)--no-user-interaction[don't authenticate the user if needed]" && ret=0
;; ;;
smart-simulate) smart-simulate)
_arguments \ _arguments \
{-f,--file}'[File with libatasmart blob]:files:_files' \ {-f,--file}'[file with libatasmart blob]:files:_files' \
{-p,--object-path}'[Object to get information about]:object path:_paths' \ {-p,--object-path}'[object to get information about]:object path:_paths' \
{-b,--block-device}'[Block device to get information about]:block device:_paths' \ {-b,--block-device}'[block device to get information about]:block device:_paths' \
'(--no-user-interaction)--no-user-interaction[Do not authenticate the user if needed]' \ "(--no-user-interaction)--no-user-interaction[don't authenticate the user if needed]" && ret=0
;; ;;
esac esac
;; ;;
esac esac
return ret
} }
_udisksctl "$@" _udisksctl "$@"

View File

@ -41,7 +41,7 @@
_ufw_logging() { _ufw_logging() {
local main additional second local params additional second
second=$words[2] second=$words[2]
if [ ! -z $second ]; then if [ ! -z $second ]; then
@ -60,8 +60,8 @@ _ufw_logging() {
"full" "full"
) )
_describe -t params 'On/Off' params _describe -t params 'on/off' params
_describe -t additional 'Level' additional _describe -t additional 'level' additional
} }
@ -85,35 +85,34 @@ _ufw_delete() {
} }
_ufw() { _ufw() {
local -a commands local curcontext="$curcontext" ret=1
local -a state line commands
commands=( commands=(
"enable:Enables the firewall" "enable:enable the firewall"
"disable:Disables the firewall" "disable:disable the firewall"
"default:Set default policy" "default:set default policy"
"logging:Set logging to LEVEL" "logging:set logging level"
"allow:Add allow rule" "allow:add allow rule"
"deny:Add deny rule" "deny:add deny rule"
"reject:Add reject rule" "reject:add reject rule"
"limit:Add limit rule" "limit:add limit rule"
"delete:Delete RULE" "delete:delete rule"
"insert:Insert RULE at NUM" "insert:insert rule at position"
"route:Add route RULE" "route:add route rule"
"reload:Reload firewall" "reload:reload firewall"
"reset:Reset firewall" "reset:reset firewall"
"status:Show firewall status" "status:show firewall status"
"show:Show firewall report" "show:show firewall report"
"version:Display version information" "version:display version information"
) )
_arguments -C -s -S -n \ _arguments -C -s -S -n \
'(- 1 *)'--version"[Show program\'s version number and exit]: :->full" \ '(- 1 *)'--version"[display version information]: :->full" \
'(- 1 *)'{-h,--help}'[Show help message and exit]: :->full' \ '(- 1 *)'{-h,--help}'[display usage information]: :->full' \
'(- 1 *)'--dry-run"[Don\'t modify anything, just show the changes]: :->cmds" \ '(- 1 *)'--dry-run"[don't modify anything, just show the changes]: :->cmds" \
'1:cmd:->cmds' \ '1:cmd:->cmds' \
'*:: :->args' \ '*:: :->args' && ret=0
case "$state" in case "$state" in
(cmds) (cmds)
@ -124,19 +123,21 @@ _ufw() {
cmd=$words[1] cmd=$words[1]
case "$cmd" in case "$cmd" in
(logging) (logging)
_ufw_logging _ufw_logging && ret=0
;; ;;
(delete) (delete)
_ufw_delete _ufw_delete && ret=0
;; ;;
(*) (*)
return _default && ret=0
;; ;;
esac esac
;; ;;
(*) (*)
;; ;;
esac esac
return ret
} }
_ufw _ufw

View File

@ -38,73 +38,75 @@
# #
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
local context state state_descr line local curcontext="$curcontext" state state_descr line ret=1
typeset -A opt_args typeset -A opt_args
local period="-d --days -h --hours -m --months -w --weeks" local period="-d --days -h --hours -m --months -w --weeks"
_arguments : \ _arguments -C : \
'--cleartop[Remove all top 10 entries]' \ '--cleartop[remove all top 10 entries]' \
'--config[Specify alternate configuration file]:file:_files' \ '--config[specify alternate configuration file]:file:_files' \
"($period)"{-d,--days}'[Show traffic for days]' \ "($period)"{-d,--days}'[show traffic for days]' \
"($period)"{-h,--hours}'[Show trafic for last 24 hours]' \ "($period)"{-h,--hours}'[show trafic for last 24 hours]' \
"($period)"{-m,--months}'[Show traffic for months]' \ "($period)"{-m,--months}'[show traffic for months]' \
"($period)"{-w,--weeks}'[Show traffic for 7 days]' \ "($period)"{-w,--weeks}'[show traffic for 7 days]' \
'--dbdir[Specify database directory]:directory:_files -/' \ '--dbdir[specify database directory]:directory:_files -/' \
'(-D --debug)'{-D,--debug}'[Show additional debug output]' \ '(-D --debug)'{-D,--debug}'[show additional debug output]' \
'--delete[Delete database and stop monitoring selected interface]' \ '--delete[delete database and stop monitoring selected interface]' \
'--dumpdb[Dump database in parseable format]' \ '--dumpdb[dump database in parseable format]' \
'(--disable)--enable[Enable updates for selected interface]' \ '(--disable)--enable[enable updates for selected interface]' \
'(--enable)--disable[Disable updates for selected interface]' \ '(--enable)--disable[disable updates for selected interface]' \
'(-i --iface)'{-i,--iface}'[Specify interface for actions]:interface:->interface' \ '(-i --iface)'{-i,--iface}'[specify interface for actions]:interface:->interface' \
'--iflist[List available interfaces]' \ '--iflist[list available interfaces]' \
'(-l --live)'{-l,--live}'[Display current transfer rate]:mode:->live' \ '(-l --live)'{-l,--live}'[display current transfer rate]:mode:->live' \
'--locale[Specify locale]:locale:' \ '--locale[specify locale]:locale:' \
'--nick[Set nickname for alias]:nickname:' \ '--nick[set nickname for alias]:nickname:' \
'--oneline[Traffic summary in one-line, parseable format]' \ '--oneline[traffic summary in one-line, parseable format]' \
'(-q --query)'{-q,--query}'[Force database query mode]' \ '(-q --query)'{-q,--query}'[force database query mode]' \
'(-r --reset)'{-r,--reset}'[Reset internal counters]' \ '(-r --reset)'{-r,--reset}'[reset internal counters]' \
'--rebuildtotal[Reset total trafic counters]' \ '--rebuildtotal[reset total trafic counters]' \
'(-ru --rateunit)'{-ru,--rateunit}'[Swap configured rate unit]' \ '(-ru --rateunit)'{-ru,--rateunit}'[swap configured rate unit]' \
'--savemerged[Write result of database merge]' \ '--savemerged[write result of database merge]' \
'(-s --short)'{-s,--short}'[Use short output mode]' \ '(-s --short)'{-s,--short}'[use short output mode]' \
'--style[Modify content and style of output]:style:->style' \ '--style[modify content and style of output]:style:->style' \
'--sync[Synchronize internal counters]' \ '--sync[synchronize internal counters]' \
'--testkernel[Test kernel boot time information]' \ '--testkernel[test kernel boot time information]' \
'(-t --top10)'{-t,--top10}'[Show all time top 10 traffic days]' \ '(-t --top10)'{-t,--top10}'[show all time top 10 traffic days]' \
'-tr[Calculate amount of traffic in given time]:seconds:' \ '-tr[calculate amount of traffic in given time]:seconds:' \
'(-u --update)'{-u,--update}'[Update databases]' \ '(-u --update)'{-u,--update}'[update databases]' \
'--xml[Show database content in XML format]' \ '--xml[show database content in XML format]' \
'(-)'{-v,--version}'[Show current version]' \ '(-)'{-v,--version}'[show current version]' \
'(-)'{-\?,--help}'[Show command summary]' \ '(-)'{-\?,--help}'[show command summary]' \
'(-)--longhelp[Show complete options list]' \ '(-)--longhelp[show complete options list]' \
&& ret=0 && ret=0
case "$state" in case "$state" in
(live) (live)
_values 'Live mode' \ _values 'live mode' \
'0[Packets per second]' \ '0[packets per second]' \
'1[Traffic counters]' '1[traffic counters]' && ret=0
;; ;;
(style) (style)
_values 'Output style' \ _values 'output style' \
'0[Narrow output]' \ '0[narrow output]' \
'1[Enable bar column]' \ '1[enable bar column]' \
'2[Bar column with average traffic rate]' \ '2[bar column with average traffic rate]' \
'3[Enable average traffic rate]' \ '3[enable average traffic rate]' \
'4[Disable use of terminal control characters]' '4[disable use of terminal control characters]' && ret=0
;; ;;
(interface) (interface)
local interfaces="$(_call_program interfaces 'vnstat --iflist')" local interfaces="$(_call_program interfaces 'vnstat --iflist')"
interfaces="${interfaces#*:}" interfaces="${interfaces#*:}"
_values -s + 'Interface' ${(z)interfaces} _values -s + 'interface' ${(z)interfaces} && ret=0
;; ;;
esac esac
return ret
# Local Variables: # Local Variables:
# mode: Shell-Script # mode: Shell-Script
# sh-indentation: 2 # sh-indentation: 2

View File

@ -35,13 +35,13 @@ _vpnc-connect() {
'--ifname[visible name of the TUN/TAP interface]:name' \ '--ifname[visible name of the TUN/TAP interface]:name' \
'--ifmode[mode of TUN/TAP interface]: :_vpnc_tun_tap_modes' \ '--ifmode[mode of TUN/TAP interface]: :_vpnc_tun_tap_modes' \
'--debug[show verbose debug messages]: :_vpnc_debug_levels' \ '--debug[show verbose debug messages]: :_vpnc_debug_levels' \
'--no-detach[Don'\''t detach from the console after login]' \ "--no-detach[don't detach from the console after login]" \
'--pid-file[store the pid of background process in the file]:pid file:_files' \ '--pid-file[store the pid of background process in the file]:pid file:_files' \
'--local-addr[local IP to use for ISAKMP/ESP/...]: :_hosts' \ '--local-addr[local IP to use for ISAKMP/ESP/...]: :_hosts' \
'--local-port[local ISAKMP port number to use]: :_vpnc_isakmp_port_numbers' \ '--local-port[local ISAKMP port number to use]: :_vpnc_isakmp_port_numbers' \
'--udp-port[local UDP port number to use]: :_vpnc_udp_port_numbers' \ '--udp-port[local UDP port number to use]: :_vpnc_udp_port_numbers' \
'--dpd-idle[send DPD packet after not receiving anything for X seconds]: :_vpnc_dpd_idle_times' \ '--dpd-idle[send DPD packet after not receiving anything for X seconds]: :_vpnc_dpd_idle_times' \
'--non-inter[Don'\''t ask anything, exit on missing options]' \ "--non-inter[don't ask anything, exit on missing options]" \
'--auth-mode[authentication mode]: :_vpnc_authentication_modes' \ '--auth-mode[authentication mode]: :_vpnc_authentication_modes' \
'--ca-file[filename and path to the CA-PEM-File]:CA-PEM file:_files' \ '--ca-file[filename and path to the CA-PEM-File]:CA-PEM file:_files' \
'--ca-dir[path of the trusted CA-Directory]:CA directory:_files -/' \ '--ca-dir[path of the trusted CA-Directory]:CA directory:_files -/' \
@ -116,7 +116,7 @@ _vpnc_tun_tap_modes() {
(( $+functions[_vpnc_debug_levels] )) || (( $+functions[_vpnc_debug_levels] )) ||
_vpnc_debug_levels() { _vpnc_debug_levels() {
local levels; levels=( local levels; levels=(
'0:do not print debug information' "0:don't print debug information"
'1:print minimal debug information' '1:print minimal debug information'
'2:show statemachine and packet/payload type information' '2:show statemachine and packet/payload type information'
'3:dump everything excluding authentication data' '3:dump everything excluding authentication data'

View File

@ -92,7 +92,7 @@ _yaourt_action_sync() {
_arguments -s : \ _arguments -s : \
"$_yaourt_opts_common[@]" \ "$_yaourt_opts_common[@]" \
"$_yaourt_opts_sync_modifiers[@]" \ "$_yaourt_opts_sync_modifiers[@]" \
'*-c[Remove old packages from cache]' \ '*-c[remove old packages from cache]' \
;; ;;
sync_group) sync_group)
_arguments -s : \ _arguments -s : \
@ -213,110 +213,110 @@ _yaourt() {
# options for passing to _arguments: main pacman commands # options for passing to _arguments: main pacman commands
typeset -a _yaourt_opts_commands typeset -a _yaourt_opts_commands
_yaourt_opts_commands=( _yaourt_opts_commands=(
'-Q[Query the package database]' '-Q[query the package database]'
'-R[Remove a package from the system]' '-R[remove a package from the system]'
'-S[Synchronize packages]' '-S[synchronize packages]'
'-U[Upgrade a package]' '-U[upgrade a package]'
'-V[Display version and exit]' '-V[display version and exit]'
'-h[Display usage]' '-h[display usage information]'
'-B[backup pacman database]' '-B[backup pacman database]'
'-G[Get PKGBUILD]' '-G[get PKGBUILD]'
'-C[Clean backup files]' '-C[clean backup files]'
'--stats[Package Statistics]' '--stats[package statistics]'
) )
# options for passing to _arguments: options common to all commands # options for passing to _arguments: options common to all commands
typeset -a _yaourt_opts_common typeset -a _yaourt_opts_common
_yaourt_opts_common=( _yaourt_opts_common=(
'-b[Alternate database location]:database_location:_files -/' '-b[alternate database location]:database_location:_files -/'
'-h[Display syntax for the given operation]' '-h[display syntax for the given operation]'
'-r[Alternate installation root]:installation root:_files -/' '-r[alternate installation root]:installation root:_files -/'
'-v[Be more verbose]' '-v[be more verbose]'
'--cachedir[Alternate package cache location]:cache_location:_files -/' '--cachedir[specify alternate package cache location]:cache_location:_files -/'
'--config[Alternate configuration file]:config file:_files' '--config[specify alternate configuration file]:config file:_files'
'--debug[Display debug messages]' '--debug[display debug messages]'
'--gpgdir[Alternate GnuPG home directory]:gpg_directory:_files -/' '--gpgdir[specify alternate GnuPG home directory]:gpg_directory:_files -/'
'--logfile[Alternate log file]:config file:_files' '--logfile[specify alternate log file]:config file:_files'
'--noconfirm[Do not ask for confirmation]' "--noconfirm[don't ask for confirmation]"
'--noprogressbar[Do not show a progress bar when downloading files]' "--noprogressbar[don't show a progress bar when downloading files]"
'--noscriptlet[Do not execute the install scriptlet if one exists]' "--noscriptlet[don't execute the install scriptlet if one exists]"
'--print[Only print the targets instead of performing the operation]' '--print[only print the targets instead of performing the operation]'
) )
# options for passing to _arguments: options for --upgrade commands # options for passing to _arguments: options for --upgrade commands
typeset -a _yaourt_opts_pkgfile typeset -a _yaourt_opts_pkgfile
_yaourt_opts_pkgfile=( _yaourt_opts_pkgfile=(
'-d[Skip dependency checks]' '-d[skip dependency checks]'
'-f[Overwrite conflicting files]' '-f[overwrite conflicting files]'
'*:package file:_files -g "*.pkg.tar*(.)"' '*:package file:_files -g "*.pkg.tar*(.)"'
) )
# options for passing to _arguments: subactions for --query command # options for passing to _arguments: subactions for --query command
typeset -a _yaourt_opts_query_actions typeset -a _yaourt_opts_query_actions
_yaourt_opts_query_actions=( _yaourt_opts_query_actions=(
'-g[View all members of a package group]:*:package groups:->query_group' '-g[view all members of a package group]:*:package groups:->query_group'
'-o[Query the package that owns a file]:file:_files' '-o[query the package that owns a file]:file:_files'
'-p[Package file to query]:*:package file:->query_file' '-p[package file to query]:*:package file:->query_file'
'-s[Search package names and descriptions]:*:search text:->query_search' '-s[search package names and descriptions]:*:search text:->query_search'
) )
# options for passing to _arguments: options for --query and subcommands # options for passing to _arguments: options for --query and subcommands
typeset -a _yaourt_opts_query_modifiers typeset -a _yaourt_opts_query_modifiers
_yaourt_opts_query_modifiers=( _yaourt_opts_query_modifiers=(
'-c[List package changelog]' '-c[list package changelog]'
'-d[List packages installed as dependencies]' '-d[list packages installed as dependencies]'
'-e[List packages explicitly installed]' '-e[list packages explicitly installed]'
'-i[View package information]' '-i[view package information]'
'-ii[View package information including backup files]' '-ii[view package information including backup files]'
'-k[Check package files]' '-k[check package files]'
'-l[List package contents]' '-l[list package contents]'
'-m[List installed packages not found in sync db(s)]' '-m[list installed packages not found in sync db(s)]'
'-t[List packages not required by any package]' '-t[list packages not required by any package]'
'-u[List packages that can be upgraded]' '-u[list packages that can be upgraded]'
'--aur[Install packages from aur, even if they are in community, or, with the -u option, update packages installed from aur]' '--aur[install packages from aur, even if they are in community, or, with the -u option, update packages installed from aur]'
'--devel[Used with -u updates all cvs/svn/git/hg/bzr packages]' '--devel[used with -u updates all cvs/svn/git/hg/bzr packages]'
'--date[List packages sorted ascendingly (oldest is printed first) by installation date]' '--date[list packages sorted in ascending order (oldest first) by installation date]'
) )
# options for passing to _arguments: options for --remove command # options for passing to _arguments: options for --remove command
typeset -a _yaourt_opts_remove typeset -a _yaourt_opts_remove
_yaourt_opts_remove=( _yaourt_opts_remove=(
'-c[Remove all dependent packages]' '-c[remove all dependent packages]'
'-d[Skip dependency checks]' '-d[skip dependency checks]'
'-k[Only remove database entry, do not remove files]' "-k[only remove database entry, don't remove files]"
'-n[Remove protected configuration files]' '-n[remove protected configuration files]'
'-s[Remove dependencies not required by other packages]' '-s[remove dependencies not required by other packages]'
'*:installed package:_yaourt_completions_installed_packages' '*:installed package:_yaourt_completions_installed_packages'
) )
# options for passing to _arguments: options for --sync command # options for passing to _arguments: options for --sync command
typeset -a _yaourt_opts_sync_actions typeset -a _yaourt_opts_sync_actions
_yaourt_opts_sync_actions=( _yaourt_opts_sync_actions=(
'*-c[Remove old packages from cache]:*:clean:->sync_clean' '*-c[remove old packages from cache]:*:clean:->sync_clean'
'*-cc[Remove all packages from cache]:*:clean:->sync_clean' '*-cc[remove all packages from cache]:*:clean:->sync_clean'
'-g[View all members of a package group]:*:package groups:->sync_group' '-g[view all members of a package group]:*:package group:->sync_group'
'-s[Search package names and descriptions]:*:search text:->sync_search' '-s[search package names and descriptions]:*:search text:->sync_search'
) )
# options for passing to _arguments: options for --sync command # options for passing to _arguments: options for --sync command
typeset -a _yaourt_opts_sync_modifiers typeset -a _yaourt_opts_sync_modifiers
_yaourt_opts_sync_modifiers=( _yaourt_opts_sync_modifiers=(
'-d[Skip dependency checks]' '-d[skip dependency checks]'
'-f[Overwrite conflicting files]' '-f[overwrite conflicting files]'
'-i[View package information]' '-i[view package information]'
'-l[List all packages in a repository]' '-l[list all packages in a repository]'
'-p[Print download URIs for each package to be installed]' '-p[print download URIs for each package to be installed]'
'-u[Upgrade all out-of-date packages]' '-u[upgrade all out-of-date packages]'
'-w[Download packages only]' '-w[download packages only]'
'-y[Download fresh package databases]' '-y[download fresh package databases]'
'*--ignore[Ignore a package upgrade]:package: '*--ignore[ignore a package upgrade]:package:
_yaourt_completions_all_packages' _yaourt_completions_all_packages'
'*--ignoregroup[Ignore a group upgrade]:package group: '*--ignoregroup[ignore a group upgrade]:package group:
_yaourt_completions_all_groups' _yaourt_completions_all_groups'
'--asdeps[Install packages as non-explicitly installed]' '--asdeps[install packages as non-explicitly installed]'
'--asexplicit[Install packages as explicitly installed]' '--asexplicit[install packages as explicitly installed]'
'--needed[Do not reinstall up to date packages]' "--needed[don't reinstall up to date packages]"
'--devel[Used with -u updates all cvs/svn/git/hg/bzr packages]' '--devel[used with -u updates all cvs/svn/git/hg/bzr packages]'
) )
case $words[2] in case $words[2] in

View File

@ -38,25 +38,24 @@
# #
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
_zcash-cli() { local state line curcontext="$curcontext" ret=1
local context state line curcontext="$curcontext"
_arguments -C \ _arguments -C \
-?'[This help message]' \ '-?[display usage information]' \
-conf='[Specify configuration file (default: zcash.conf)]:PATH:_files' \ -conf='[specify configuration file]:file [zcash.conf]:_files' \
-datadir='[Specify data directory]:PATH:_directories' \ -datadir='[specify data directory]:directory:_directories' \
-testnet'[Use the test network]' \ -testnet'[use the test network]' \
-regtest'[Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development.]' \ -regtest'[enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development.]' \
-rpcconnect='[Send commands to node running on <ip> (default: 127.0.0.1)]:RPCCONNECT:_hosts' \ -rpcconnect='[send commands to node running on specified ip]:rpcconnect [127.0.0.1]:_hosts' \
-rpcport='[Connect to JSON-RPC on <port> (default: 8232 or testnet: 18232)]: :_guard "[[\:digit\:]]#" "PORT"' \ -rpcport='[connect to JSON-RPC on specified port]: :_guard "[[\:digit\:]]#" "port [8232 or testnet\: 18232]"' \
-rpcwait'[Wait for RPC server to start]' \ -rpcwait'[wait for RPC server to start]' \
-rpcuser='[Username for JSON-RPC connections]:RPCUSER:()' \ -rpcuser='[username for JSON-RPC connections]:rpcuser' \
-rpcpassword='[Password for JSON-RPC connections]:RPCPASSWORD:()' \ -rpcpassword='[password for JSON-RPC connections]:rpcpassword' \
-rpcclienttimeout='[Timeout in seconds during HTTP requests, or 0 for no timeout. (default: 900)]: :_guard "[[\:digit\:]]#" "RPCCLIENTTIMEOUT"' \ -rpcclienttimeout='[specify timeout during HTTP requests, or 0 for no timeout]: :_guard "[[\:digit\:]]#" "timeout (seconds) [900]"' \
':subcommand:->subcommand' && ret=0 ':subcommand:->subcommand' && ret=0
case $state in case $state in
subcommand) subcommand)
subcommands=( subcommands=(
'getbestblockhash' 'getbestblockhash'
'getblock' 'getblock'
@ -167,13 +166,11 @@ _zcash-cli() {
'zcsamplejoinsplit' 'zcsamplejoinsplit'
) )
_describe -t subcommands 'zcash-cli subcommands' subcommands && ret=0 _describe -t subcommands 'zcash-cli subcommand' subcommands && ret=0
esac ;;
esac
return ret return ret
}
_zcash-cli "$@"
# Local Variables: # Local Variables:
# mode: Shell-Script # mode: Shell-Script