Merge pull request #1134 from zsh-users/update-completions
Update shallow-backup, ufw completions
This commit is contained in:
commit
99d000d880
|
@ -42,6 +42,10 @@ _setcap() {
|
||||||
local curcontext=$curcontext state line expl ret=1
|
local curcontext=$curcontext state line expl ret=1
|
||||||
|
|
||||||
_arguments -C -s \
|
_arguments -C -s \
|
||||||
|
'-r[remove capability from file]' \
|
||||||
|
'--license[display the license info]' \
|
||||||
|
'-f[force setting even when the capability is invalid]' \
|
||||||
|
'-h[show help message and exit]' \
|
||||||
'-v[verify that the specified capabilities are currently associated with the file]' \
|
'-v[verify that the specified capabilities are currently associated with the file]' \
|
||||||
'-n[set the file capability for use only in a user namespace with this root user ID owner]:rootuid' \
|
'-n[set the file capability for use only in a user namespace with this root user ID owner]:rootuid' \
|
||||||
'-q[make the program less verbose in its output]' \
|
'-q[make the program less verbose in its output]' \
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
# Description
|
# Description
|
||||||
# -----------
|
# -----------
|
||||||
#
|
#
|
||||||
# Completion script for shallow-backup: https://github.com/alichtman/shallow-backup
|
# Completion script for shallow-backup v6.4: https://github.com/alichtman/shallow-backup
|
||||||
#
|
#
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Authors
|
# Authors
|
||||||
|
@ -38,7 +38,6 @@
|
||||||
#
|
#
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
_shallow-backup() {
|
_shallow-backup() {
|
||||||
_arguments \
|
_arguments \
|
||||||
'(- 1 *)'{-h,--help}'[Show help and exit]' \
|
'(- 1 *)'{-h,--help}'[Show help and exit]' \
|
||||||
|
@ -61,6 +60,7 @@ _shallow-backup() {
|
||||||
'--reinstall-fonts[Reinstall fonts]' \
|
'--reinstall-fonts[Reinstall fonts]' \
|
||||||
'--reinstall-packages[Reinstall packages]' \
|
'--reinstall-packages[Reinstall packages]' \
|
||||||
'--remote[Set remote URL for the git repo]':url \
|
'--remote[Set remote URL for the git repo]':url \
|
||||||
|
'--edit[Open config file in $EDITOR]' \
|
||||||
'--show[Display config file]'
|
'--show[Display config file]'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
# -------
|
# -------
|
||||||
#
|
#
|
||||||
# * Bruno Michel (https://github.com/nono)
|
# * Bruno Michel (https://github.com/nono)
|
||||||
# * Shoehi Yoshida (https://github.com/nono)
|
# * Shohei Yoshida (https://github.com/nono)
|
||||||
#
|
#
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ _showoff() {
|
||||||
'(-f --file --pres_file)'{-f,--file,--pres_file}='[JSON file used to describe presentation(default: showoff.json)]: :_files -g "*.json"' \
|
'(-f --file --pres_file)'{-f,--file,--pres_file}='[JSON file used to describe presentation(default: showoff.json)]: :_files -g "*.json"' \
|
||||||
'--git_branch=[Branch of git repository to use(default: none)]:branch' \
|
'--git_branch=[Branch of git repository to use(default: none)]:branch' \
|
||||||
'--git_path=[Path of the presentation within the git repository(default: none)]:path' \
|
'--git_path=[Path of the presentation within the git repository(default: none)]:path' \
|
||||||
'(-h --host)'{-h,--host}='[Host or ip to run on(default: 0.0.0.0)]' \
|
'(-h --host)'{-h,--host}='[Host or IP to run on(default: 0.0.0.0)]' \
|
||||||
'--nocache[Disable content caching]'\
|
'--nocache[Disable content caching]'\
|
||||||
'--nosleep[Prevent the computer from sleeping during your presentation]' \
|
'--nosleep[Prevent the computer from sleeping during your presentation]' \
|
||||||
'(-p --port)'{-p,--port}='[Port on which to run(default: 9090)]' \
|
'(-p --port)'{-p,--port}='[Port on which to run(default: 9090)]' \
|
||||||
|
|
56
src/_ufw
56
src/_ufw
|
@ -28,7 +28,7 @@
|
||||||
# Description
|
# Description
|
||||||
# -----------
|
# -----------
|
||||||
#
|
#
|
||||||
# Completion script for The Uncomplicated Firewall (ufw). (https://launchpad.net/ufw).
|
# Completion script for The Uncomplicated Firewall (ufw) v0.36.2. (https://launchpad.net/ufw).
|
||||||
#
|
#
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Authors
|
# Authors
|
||||||
|
@ -38,9 +38,7 @@
|
||||||
#
|
#
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
_ufw_logging() {
|
_ufw_logging() {
|
||||||
|
|
||||||
local params additional second
|
local params additional second
|
||||||
second=$words[2]
|
second=$words[2]
|
||||||
|
|
||||||
|
@ -48,23 +46,13 @@ _ufw_logging() {
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
params=(
|
params=("on" "off")
|
||||||
"on"
|
additional=("low" "medium" "high" "full")
|
||||||
"off"
|
|
||||||
)
|
|
||||||
|
|
||||||
additional=(
|
|
||||||
"low"
|
|
||||||
"medium"
|
|
||||||
"high"
|
|
||||||
"full"
|
|
||||||
)
|
|
||||||
|
|
||||||
_describe -t params 'on/off' params
|
_describe -t params 'on/off' params
|
||||||
_describe -t additional 'level' additional
|
_describe -t additional 'level' additional
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
_ufw_delete() {
|
_ufw_delete() {
|
||||||
local rules complrules second
|
local rules complrules second
|
||||||
|
|
||||||
|
@ -84,6 +72,31 @@ _ufw_delete() {
|
||||||
_describe -t complrules 'Rules' complrules
|
_describe -t complrules 'Rules' complrules
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_ufw_app() {
|
||||||
|
local ret=1
|
||||||
|
|
||||||
|
local -a subcmds=(
|
||||||
|
"list:list application profiles"
|
||||||
|
"info:show information on profile"
|
||||||
|
"update:update profile"
|
||||||
|
"default:set default application profile"
|
||||||
|
)
|
||||||
|
|
||||||
|
_arguments \
|
||||||
|
"1: :{_describe 'command' subcmds}" \
|
||||||
|
&& ret=0
|
||||||
|
|
||||||
|
return ret
|
||||||
|
}
|
||||||
|
|
||||||
|
(( $+functions[_flutter_pub_token_subcommand] )) ||
|
||||||
|
_flutter_pub_token_subcommand() {
|
||||||
|
local -a subcommands=(
|
||||||
|
|
||||||
|
)
|
||||||
|
_describe -t subcommands 'subcommand' subcommands "$@"
|
||||||
|
}
|
||||||
|
|
||||||
_ufw() {
|
_ufw() {
|
||||||
local curcontext="$curcontext" ret=1
|
local curcontext="$curcontext" ret=1
|
||||||
local -a state line commands
|
local -a state line commands
|
||||||
|
@ -106,6 +119,7 @@ _ufw() {
|
||||||
"show:show firewall report"
|
"show:show firewall report"
|
||||||
"version:display version information"
|
"version:display version information"
|
||||||
"prepend:add rule before all of the same type"
|
"prepend:add rule before all of the same type"
|
||||||
|
"app:application profile command"
|
||||||
)
|
)
|
||||||
|
|
||||||
_arguments -C -s -S -n \
|
_arguments -C -s -S -n \
|
||||||
|
@ -129,6 +143,9 @@ _ufw() {
|
||||||
(delete)
|
(delete)
|
||||||
_ufw_delete && ret=0
|
_ufw_delete && ret=0
|
||||||
;;
|
;;
|
||||||
|
(app)
|
||||||
|
_ufw_app && ret=0
|
||||||
|
;;
|
||||||
(*)
|
(*)
|
||||||
_default && ret=0
|
_default && ret=0
|
||||||
;;
|
;;
|
||||||
|
@ -141,5 +158,12 @@ _ufw() {
|
||||||
return ret
|
return ret
|
||||||
}
|
}
|
||||||
|
|
||||||
_ufw
|
_ufw "$@"
|
||||||
|
|
||||||
|
# Local Variables:
|
||||||
|
# mode: Shell-Script
|
||||||
|
# sh-indentation: 2
|
||||||
|
# indent-tabs-mode: nil
|
||||||
|
# sh-basic-offset: 2
|
||||||
|
# End:
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
|
Loading…
Reference in New Issue