~craftyguy/superd

53c5a9b83fbac851fcbc34dbba72697ff73e2b67 — triallax 1 year, 7 months ago a1ecad6
completions: misc updates
3 files changed, 7 insertions(+), 6 deletions(-)

M completions/bash/superctl
M completions/fish/superctl.fish
M completions/zsh/superctl
M completions/bash/superctl => completions/bash/superctl +2 -2
@@ 1,7 1,7 @@
# completion file for bash

__superctl_subcommands() {
	printf "start\nstop\nrestart\nenable\ndisable\nstatus\nset\nreload\n"
	printf "start\nstop\nrestart\nenable\ndisable\nstatus\nset\nreload\nlog\n"
}

__superctl__services() {


@@ 22,7 22,7 @@ __superctl_completion()
	fi

	case "${COMP_WORDS[1]}" in
		status|start|stop|restart)
		status|start|stop|restart|log)
			if [ "$COMP_CWORD" -eq 2 ]; then
				COMPREPLY=($(compgen -W "$(__superctl__services)" -- "${COMP_WORDS[$COMP_CWORD]}"))
			fi

M completions/fish/superctl.fish => completions/fish/superctl.fish +3 -2
@@ 1,6 1,6 @@
complete -c superctl -f

complete -c superctl -n __fish_use_subcommand -a status -d 'Get status for the given service, or all services if not specified'
complete -c superctl -n __fish_use_subcommand -a status -d 'Get status for the given service(s), or all services if not specified'
complete -c superctl -n __fish_use_subcommand -a start -d 'Start the given service'
complete -c superctl -n __fish_use_subcommand -a stop -d 'Stop the given service'
complete -c superctl -n __fish_use_subcommand -a restart -d 'Restart the given service'


@@ 8,10 8,11 @@ complete -c superctl -n __fish_use_subcommand -a enable -d 'Enable the given ser
complete -c superctl -n __fish_use_subcommand -a disable -d 'Disable the given service'
complete -c superctl -n __fish_use_subcommand -a set-env -d 'Set environment variables for running services'
complete -c superctl -n __fish_use_subcommand -a reload -d 'Reload service config from disk, adding any new config found'
complete -c superctl -n __fish_use_subcommand -a log -d 'Show log for given service, or for superd if none specified'

complete -c superctl -s h -l help -d 'Display help and exit'
complete -c superctl -l version -d 'Display version and exit'

complete -c superctl -n '__fish_seen_subcommand_from status start stop restart enable disable' -xa '(superctl status | string split " " -f1)'
complete -c superctl -n '__fish_seen_subcommand_from status start stop restart enable disable log' -xa '(superctl status | string split " " -f1)'
complete -c superctl -n '__fish_seen_subcommand_from enable' -s n -l now -d 'Start service after enabling it'
complete -c superctl -n '__fish_seen_subcommand_from disable' -s n -l now -d 'Stop service after disabling it'

M completions/zsh/superctl => completions/zsh/superctl +2 -2
@@ 16,7 16,7 @@ _superctl() {
                "restart[Restart the given service]" \
                "enable[Enable the given service]" \
                "disable[Disable the given service]" \
                "status[Get status for the give service(s), or all services if not specified]" \
                "status[Get status for the given service(s), or all services if not specified]" \
                "set-env[Set one or more environment variables for running services, either to the value specified or the value from the current environment if it is set]" \
                "reload[Reload service config from disk, adding any new config found]" \
                "log[Show log for given service, or for superd if none specified]" \


@@ 41,7 41,7 @@ _superctl() {
                enable)
                    _arguments -s \
                        ':services:($services)' \
                        {-n,--now}"[Stop service after disabling it]"
                        {-n,--now}"[Start service after enabling it]"
                    ;;
                disable)
                    _arguments -s \