-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
install: ```sh install -m644 ./install/shell-completion/dae.zsh /usr/share/zsh/site-functions/_dae ``` Signed-off-by: ston <ston.jia@qq.com>
- Loading branch information
Showing
1 changed file
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
#compdef _dae dae | ||
|
||
_dae() { | ||
local line | ||
|
||
_arguments -C \ | ||
"-h[help for dae]" \ | ||
"--help[help for dae]" \ | ||
"-v[version for dae]" \ | ||
"--version[version for dae]" \ | ||
"1: :(export help honk reload run suspend validate)" \ | ||
"*::arg:->args" | ||
|
||
case $line[1] in | ||
export) | ||
_dae_export | ||
;; | ||
help) | ||
_dae_help | ||
;; | ||
reload) | ||
_dae_reload | ||
;; | ||
run) | ||
_dae_run | ||
;; | ||
suspend) | ||
_dae_suspend | ||
;; | ||
validate) | ||
_dae_validate | ||
;; | ||
esac | ||
|
||
} | ||
|
||
_dae_export() { | ||
_arguments -C \ | ||
"-h[help for export]" \ | ||
"--help[help for export]" \ | ||
"1: :(outline)" | ||
} | ||
|
||
_dae_help() { | ||
_arguments -C \ | ||
"-h[help for help]" \ | ||
"--help[help for help]" \ | ||
"1: :(export help honk reload run suspend validate)" | ||
} | ||
|
||
_dae_reload() { | ||
_arguments -C \ | ||
"-h[help for reload]" \ | ||
"--help[help for reload]" \ | ||
"::pid:($(ps -A | awk '{print $1}'))" | ||
} | ||
|
||
_dae_suspend() { | ||
_arguments -C \ | ||
"-h[help for suspend]" \ | ||
"--help[help for suspend]" \ | ||
"::pid:($(ps -A | awk '{print $1}'))" | ||
} | ||
|
||
_dae_run() { | ||
_arguments -C \ | ||
"-c[Config file of dae]:filename:_files" \ | ||
"--config[Config file of dae]:filename:_files" \ | ||
"--disable-pidfile[Not generate /var/run/dae.pid]" \ | ||
"--disable-timestamp[Disable timestamp]" \ | ||
"--logfile[Log file to write]:filename:_files" \ | ||
"--logfile-maxbackups[The maximum number of old log files to retain]" \ | ||
"--logfile-maxsize[The maximum size in megabytes of the log file before it gets rotated]" \ | ||
"-h[help for run]" \ | ||
"--help[help for run]" | ||
} | ||
|
||
_dae_validate() { | ||
_arguments -C \ | ||
"-c[Config file of dae]:filename:_files" \ | ||
"--config[Config file of dae]:filename:_files" \ | ||
"-h[help for validate]" \ | ||
"--help[help for validate]" | ||
} |