Use spaces instead of tabs
This commit is contained in:
parent
28c5bdcaf8
commit
32210c83c5
|
|
@ -40,9 +40,7 @@
|
||||||
#
|
#
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
_git-flow () {
|
||||||
_git-flow ()
|
|
||||||
{
|
|
||||||
local curcontext="$curcontext" state line
|
local curcontext="$curcontext" state line
|
||||||
typeset -A opt_args
|
typeset -A opt_args
|
||||||
|
|
||||||
|
|
@ -52,7 +50,6 @@ _git-flow ()
|
||||||
|
|
||||||
case $state in
|
case $state in
|
||||||
(command)
|
(command)
|
||||||
|
|
||||||
local -a subcommands
|
local -a subcommands
|
||||||
subcommands=(
|
subcommands=(
|
||||||
'init:Initialize a new git repo with support for the branching model.'
|
'init:Initialize a new git repo with support for the branching model.'
|
||||||
|
|
@ -67,28 +64,22 @@ _git-flow ()
|
||||||
|
|
||||||
(options)
|
(options)
|
||||||
case $line[1] in
|
case $line[1] in
|
||||||
|
|
||||||
(init)
|
(init)
|
||||||
_arguments \
|
_arguments \
|
||||||
-f'[Force setting of gitflow branches, even if already configured]' \
|
-f'[Force setting of gitflow branches, even if already configured]' \
|
||||||
-d'[Use default branch naming conventions and prefixes]'
|
-d'[Use default branch naming conventions and prefixes]'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
(version)
|
(version)
|
||||||
;;
|
;;
|
||||||
|
|
||||||
(hotfix)
|
(hotfix)
|
||||||
__git-flow-hotfix
|
__git-flow-hotfix
|
||||||
;;
|
;;
|
||||||
|
|
||||||
(release)
|
(release)
|
||||||
__git-flow-release
|
__git-flow-release
|
||||||
;;
|
;;
|
||||||
|
|
||||||
(feature)
|
(feature)
|
||||||
__git-flow-feature
|
__git-flow-feature
|
||||||
;;
|
;;
|
||||||
|
|
||||||
(support)
|
(support)
|
||||||
__git-flow-support
|
__git-flow-support
|
||||||
;;
|
;;
|
||||||
|
|
@ -98,8 +89,7 @@ _git-flow ()
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
__git-flow-release ()
|
__git-flow-release () {
|
||||||
{
|
|
||||||
local curcontext="$curcontext" state line
|
local curcontext="$curcontext" state line
|
||||||
typeset -A opt_args
|
typeset -A opt_args
|
||||||
|
|
||||||
|
|
@ -109,7 +99,6 @@ __git-flow-release ()
|
||||||
|
|
||||||
case $state in
|
case $state in
|
||||||
(command)
|
(command)
|
||||||
|
|
||||||
local -a subcommands
|
local -a subcommands
|
||||||
subcommands=(
|
subcommands=(
|
||||||
'start:Start a new release branch.'
|
'start:Start a new release branch.'
|
||||||
|
|
@ -125,13 +114,11 @@ __git-flow-release ()
|
||||||
|
|
||||||
(options)
|
(options)
|
||||||
case $line[1] in
|
case $line[1] in
|
||||||
|
|
||||||
(start)
|
(start)
|
||||||
_arguments \
|
_arguments \
|
||||||
-F'[Fetch from origin before performing finish]'\
|
-F'[Fetch from origin before performing finish]'\
|
||||||
':version:__git_flow_version_list'
|
':version:__git_flow_version_list'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
(finish)
|
(finish)
|
||||||
_arguments \
|
_arguments \
|
||||||
-F'[Fetch from origin before performing finish]' \
|
-F'[Fetch from origin before performing finish]' \
|
||||||
|
|
@ -143,19 +130,14 @@ __git-flow-release ()
|
||||||
-k'[Keep branch after performing finish]'\
|
-k'[Keep branch after performing finish]'\
|
||||||
':version:__git_flow_version_list'
|
':version:__git_flow_version_list'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
(publish)
|
(publish)
|
||||||
_arguments \
|
_arguments \
|
||||||
':version:__git_flow_version_list'
|
':version:__git_flow_version_list'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
(track)
|
(track)
|
||||||
_arguments \
|
_arguments \
|
||||||
':version:__git_flow_version_list'
|
':version:__git_flow_version_list'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
*)
|
*)
|
||||||
_arguments \
|
_arguments \
|
||||||
-v'[Verbose (more) output]'
|
-v'[Verbose (more) output]'
|
||||||
|
|
@ -165,8 +147,7 @@ __git-flow-release ()
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
__git-flow-hotfix ()
|
__git-flow-hotfix () {
|
||||||
{
|
|
||||||
local curcontext="$curcontext" state line
|
local curcontext="$curcontext" state line
|
||||||
typeset -A opt_args
|
typeset -A opt_args
|
||||||
|
|
||||||
|
|
@ -176,7 +157,6 @@ __git-flow-hotfix ()
|
||||||
|
|
||||||
case $state in
|
case $state in
|
||||||
(command)
|
(command)
|
||||||
|
|
||||||
local -a subcommands
|
local -a subcommands
|
||||||
subcommands=(
|
subcommands=(
|
||||||
'start:Start a new hotfix branch.'
|
'start:Start a new hotfix branch.'
|
||||||
|
|
@ -191,7 +171,6 @@ __git-flow-hotfix ()
|
||||||
|
|
||||||
(options)
|
(options)
|
||||||
case $line[1] in
|
case $line[1] in
|
||||||
|
|
||||||
(start)
|
(start)
|
||||||
_arguments \
|
_arguments \
|
||||||
-F'[Fetch from origin before performing finish]'\
|
-F'[Fetch from origin before performing finish]'\
|
||||||
|
|
@ -223,8 +202,7 @@ __git-flow-hotfix ()
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
__git-flow-feature ()
|
__git-flow-feature () {
|
||||||
{
|
|
||||||
local curcontext="$curcontext" state line
|
local curcontext="$curcontext" state line
|
||||||
typeset -A opt_args
|
typeset -A opt_args
|
||||||
|
|
||||||
|
|
@ -234,7 +212,6 @@ __git-flow-feature ()
|
||||||
|
|
||||||
case $state in
|
case $state in
|
||||||
(command)
|
(command)
|
||||||
|
|
||||||
local -a subcommands
|
local -a subcommands
|
||||||
subcommands=(
|
subcommands=(
|
||||||
'start:Start a new feature branch.'
|
'start:Start a new feature branch.'
|
||||||
|
|
@ -254,7 +231,6 @@ __git-flow-feature ()
|
||||||
|
|
||||||
(options)
|
(options)
|
||||||
case $line[1] in
|
case $line[1] in
|
||||||
|
|
||||||
(start)
|
(start)
|
||||||
_arguments \
|
_arguments \
|
||||||
-F'[Fetch from origin before performing finish]'\
|
-F'[Fetch from origin before performing finish]'\
|
||||||
|
|
@ -312,8 +288,7 @@ __git-flow-feature ()
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
__git-flow-support ()
|
__git-flow-support () {
|
||||||
{
|
|
||||||
local curcontext="$curcontext" state line
|
local curcontext="$curcontext" state line
|
||||||
typeset -A opt_args
|
typeset -A opt_args
|
||||||
|
|
||||||
|
|
@ -353,8 +328,7 @@ __git-flow-support ()
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
__git_flow_version_list ()
|
__git_flow_version_list () {
|
||||||
{
|
|
||||||
local expl
|
local expl
|
||||||
declare -a versions
|
declare -a versions
|
||||||
|
|
||||||
|
|
@ -364,8 +338,7 @@ __git_flow_version_list ()
|
||||||
_wanted versions expl 'version' compadd $versions
|
_wanted versions expl 'version' compadd $versions
|
||||||
}
|
}
|
||||||
|
|
||||||
__git_flow_feature_list ()
|
__git_flow_feature_list () {
|
||||||
{
|
|
||||||
local expl
|
local expl
|
||||||
declare -a features
|
declare -a features
|
||||||
|
|
||||||
|
|
@ -392,8 +365,7 @@ __git_remotes () {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
__git_flow_hotfix_list ()
|
__git_flow_hotfix_list () {
|
||||||
{
|
|
||||||
local expl
|
local expl
|
||||||
declare -a hotfixes
|
declare -a hotfixes
|
||||||
|
|
||||||
|
|
@ -403,8 +375,7 @@ __git_flow_hotfix_list ()
|
||||||
_wanted hotfixes expl 'hotfix' compadd $hotfixes
|
_wanted hotfixes expl 'hotfix' compadd $hotfixes
|
||||||
}
|
}
|
||||||
|
|
||||||
__git_flow_support_list ()
|
__git_flow_support_list () {
|
||||||
{
|
|
||||||
local expl
|
local expl
|
||||||
declare -a support
|
declare -a support
|
||||||
|
|
||||||
|
|
@ -414,7 +385,6 @@ __git_flow_support_list ()
|
||||||
_wanted hotfixes expl 'support' compadd $support
|
_wanted hotfixes expl 'support' compadd $support
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
__git_branch_names () {
|
__git_branch_names () {
|
||||||
local expl
|
local expl
|
||||||
declare -a branch_names
|
declare -a branch_names
|
||||||
|
|
|
||||||
|
|
@ -12,30 +12,31 @@
|
||||||
# * Markus Richter ( https://github.com/mqus , <mqus@disroot.org>)
|
# * Markus Richter ( https://github.com/mqus , <mqus@disroot.org>)
|
||||||
#
|
#
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
_nft(){
|
_nft(){
|
||||||
local -a rules states prev args families options descriptors
|
local -a rules states prev args families options descriptors
|
||||||
local state="start" line nextstate cmd_obj cmd_subcmd cmd_fam cmd_tab cmd_chain #curcontext="$curcontext"
|
local state="start" line nextstate cmd_obj cmd_subcmd cmd_fam cmd_tab cmd_chain #curcontext="$curcontext"
|
||||||
|
|
||||||
options=(
|
options=(
|
||||||
'(-)'{-h,--help}'[show help]' \
|
'(-)'{-h,--help}'[show help]'
|
||||||
'(-)'{-v,--version}'[print version information]' \
|
'(-)'{-v,--version}'[print version information]'
|
||||||
"(-i --interactive)"{-i,--interactive}'[read input from interactive CLI]: :->end' \
|
"(-i --interactive)"{-i,--interactive}'[read input from interactive CLI]: :->end'
|
||||||
"(-f --file)"{-f,--file}'[read input from <filename>]:nftables rule file:_files' \
|
"(-f --file)"{-f,--file}'[read input from <filename>]:nftables rule file:_files'
|
||||||
'(-c --check -n --numeric -N)'{-c,--check}"[check command's validity without actually applying the changes]" \
|
'(-c --check -n --numeric -N)'{-c,--check}"[check command's validity without actually applying the changes]"
|
||||||
'(-j --json)'{-j,--json}'[format output in json]' \
|
'(-j --json)'{-j,--json}'[format output in json]'
|
||||||
'(-c --check -N)*'{-n,--numeric}'[can be specified up to 3 times, Shows 1:network addresses(default behaviour), 2:internet services (port numbers) and 3:protocols, user IDs, and group IDs numerically]' \
|
'(-c --check -N)*'{-n,--numeric}'[can be specified up to 3 times, Shows 1:network addresses(default behaviour), 2:internet services (port numbers) and 3:protocols, user IDs, and group IDs numerically]'
|
||||||
'(-s --stateless)'{-s,--stateless}'[omit stateful information of ruleset]' \
|
'(-s --stateless)'{-s,--stateless}'[omit stateful information of ruleset]'
|
||||||
'(-N -n --numeric -c --check)'-N'[translate IP addresses to names]' \
|
'(-N -n --numeric -c --check)'-N'[translate IP addresses to names]'
|
||||||
'(-a --handle)'{-a,--handle}'[output rule handle]' \
|
'(-a --handle)'{-a,--handle}'[output rule handle]'
|
||||||
'(-e --echo)'{-e,--echo}'[echo what has been added, inserted or replaced]' \
|
'(-e --echo)'{-e,--echo}'[echo what has been added, inserted or replaced]'
|
||||||
{-I,--includepath}'[add specified directory to the paths searched for include files]:include directory [/usr/share]:include directory:_directories'
|
{-I,--includepath}'[add specified directory to the paths searched for include files]:include directory [/usr/share]:include directory:_directories'
|
||||||
)
|
)
|
||||||
|
|
||||||
# start a state machine. The state is modified by _arguments if the
|
# start a state machine. The state is modified by _arguments if the
|
||||||
# current argument (descriptors) cannot be completed. Each state has to define is successive state and the
|
# current argument (descriptors) cannot be completed. Each state has to define is successive state and the
|
||||||
# 'descriptors' for _arguments, which essentially tells _arguments how to complete
|
# 'descriptors' for _arguments, which essentially tells _arguments how to complete
|
||||||
local _i=0
|
local _i=0
|
||||||
while true;do
|
while true;do
|
||||||
(( _i+=1 ))
|
(( _i+=1 ))
|
||||||
#Guard for endless loops
|
#Guard for endless loops
|
||||||
[[ $_i -gt 100 ]] && return 1
|
[[ $_i -gt 100 ]] && return 1
|
||||||
|
|
@ -87,7 +88,7 @@ while true;do
|
||||||
(mon1)
|
(mon1)
|
||||||
case $line[1] in
|
case $line[1] in
|
||||||
(new | destroy)
|
(new | destroy)
|
||||||
# descriptors=( ":: :_nft_mon_keywords" ":: :_nft_out_format")
|
# descriptors=( ":: :_nft_mon_keywords" ":: :_nft_out_format")
|
||||||
descriptors=( ":: : _nft_mon_keywords")
|
descriptors=( ":: : _nft_mon_keywords")
|
||||||
nextstate="mon1"
|
nextstate="mon1"
|
||||||
;;
|
;;
|
||||||
|
|
@ -264,7 +265,7 @@ while true;do
|
||||||
"*:: :->$nextstate" \
|
"*:: :->$nextstate" \
|
||||||
&& return 0;
|
&& return 0;
|
||||||
|
|
||||||
done
|
done
|
||||||
} # end _nft
|
} # end _nft
|
||||||
|
|
||||||
_nft_subcommands(){
|
_nft_subcommands(){
|
||||||
|
|
@ -284,6 +285,7 @@ _nft_subcommands(){
|
||||||
)
|
)
|
||||||
_describe -t commands 'nft subcommand' commands "$@"
|
_describe -t commands 'nft subcommand' commands "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
_nft_mon_filter(){
|
_nft_mon_filter(){
|
||||||
local monitor_filters=(
|
local monitor_filters=(
|
||||||
'new:show only events of created objects'
|
'new:show only events of created objects'
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue