diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rwxr-xr-x | Completion/Base/_sub_commands | 9 | ||||
-rw-r--r-- | Completion/Core/_normal | 4 | ||||
-rwxr-xr-x | Completion/User/_apachectl | 3 | ||||
-rwxr-xr-x | Completion/User/_init_d | 5 |
5 files changed, 26 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog index c479944ad..ed046831c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2001-02-26 Sven Wischnowsky <wischnow@zsh.org> + * 13536: Completion/Base/_sub_commands, Completion/Core/_normal, + Completion/User/_apachectl, Completion/User/_init_d: some small + functions for completing sub-commands (generic function, init + scripts, apachectl) + * 13534: Completion/Builtins/_fc, Completion/Builtins/_hash, Completion/Builtins/_source, Completion/Builtins/_which, Completion/Builtins/_zftp, Completion/User/_man, diff --git a/Completion/Base/_sub_commands b/Completion/Base/_sub_commands new file mode 100755 index 000000000..429931a16 --- /dev/null +++ b/Completion/Base/_sub_commands @@ -0,0 +1,9 @@ +#autoload + +local expl + +if [[ CURRENT -eq 2 ]]; then + _wanted commands expl command compadd "$@" +else + _message 'no more arguments' +fi diff --git a/Completion/Core/_normal b/Completion/Core/_normal index 02229835a..364a56764 100644 --- a/Completion/Core/_normal +++ b/Completion/Core/_normal @@ -30,6 +30,10 @@ else eval cmd1\=$command cmd2="$command[2,-1]" curcontext="${curcontext%:*:*}:${cmd2}:" + elif [[ "$command" = ..#/* ]]; then + cmd1="${PWD}/$command" + cmd2="${command:t}" + curcontext="${curcontext%:*:*}:${cmd2}:" elif [[ "$command" = */* ]]; then cmd1="$command" cmd2="${command:t}" diff --git a/Completion/User/_apachectl b/Completion/User/_apachectl new file mode 100755 index 000000000..6516b1f84 --- /dev/null +++ b/Completion/User/_apachectl @@ -0,0 +1,3 @@ +#compdef apachectl + +_sub_commands start startssl stop restart fullstatus status graceful configtest help diff --git a/Completion/User/_init_d b/Completion/User/_init_d new file mode 100755 index 000000000..134b91cc5 --- /dev/null +++ b/Completion/User/_init_d @@ -0,0 +1,5 @@ +#compdef -P */(init|rc[0-9]#).d/* + +# This should probably be system specific... + +_sub_commands start stop |