diff options
author | Johann Weging <johann@weging.net> | 2013-05-26 21:03:08 +0200 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2013-06-02 00:36:40 -0700 |
commit | 58818e9738923719a2fc6c38f91a76f7b5971162 (patch) | |
tree | f770d19cfd8e331980913d8663e4defa03483c84 /share/completions | |
parent | 599556d7d1fde64d841f14524ce2c60b629800f0 (diff) |
Added completions for netctl
Diffstat (limited to 'share/completions')
-rw-r--r-- | share/completions/netctl.fish | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/share/completions/netctl.fish b/share/completions/netctl.fish new file mode 100644 index 00000000..595e09ad --- /dev/null +++ b/share/completions/netctl.fish @@ -0,0 +1,52 @@ +function __fish_netctl_needs_command + set cmd (commandline -opc) + if [ (count $cmd) -eq 1 -a $cmd[1] = 'netctl' ] + return 0 + end + return 1 +end + +function __fish_netctl_using_command + set cmd (commandline -opc) + if [ (count $cmd) -gt 1 ] + if [ $argv[1] = $cmd[2] ] + return 0 + end + end + return 1 +end + +function __fish_netctl_get_profiles + command netctl list | sed -e 's/^[ \t*]*//' +end + +complete -f -c netctl -l help -d 'Display help' +complete -f -c netctl -l version -d 'Display version' +complete -f -c netctl -n '__fish_netctl_needs_command' -a list -d 'List available profiles' +complete -f -c netctl -n '__fish_netctl_needs_command' -a store -d 'Save which profiles are active' +complete -f -c netctl -n '__fish_netctl_needs_command' -a restore -d 'Load saved profiles' +complete -f -c netctl -n '__fish_netctl_needs_command' -a stop-all -d 'Stops all profiles' + +complete -f -c netctl -n '__fish_netctl_needs_command' -a start -d 'Start a profile' +complete -f -c netctl -n '__fish_netctl_using_command start' -a '(__fish_netctl_get_profiles)' -d 'Profile' + +complete -f -c netctl -n '__fish_netctl_needs_command' -a stop -d 'Stop a profile' +complete -f -c netctl -n '__fish_netctl_using_command stop' -a '(__fish_netctl_get_profiles)' -d 'Profile' + +complete -f -c netctl -n '__fish_netctl_needs_command' -a restart -d 'Restart a profile' +complete -f -c netctl -n '__fish_netctl_using_command restart' -a '(__fish_netctl_get_profiles)' -d 'Profile' + +complete -f -c netctl -n '__fish_netctl_needs_command' -a switch-to -d 'Switch to a profile' +complete -f -c netctl -n '__fish_netctl_using_command switch-to' -a '(__fish_netctl_get_profiles)' -d 'Profile' + +complete -f -c netctl -n '__fish_netctl_needs_command' -a status -d 'Show runtime status of a profile' +complete -f -c netctl -n '__fish_netctl_using_command status' -a '(__fish_netctl_get_profiles)' -d 'Profile' + +complete -f -c netctl -n '__fish_netctl_needs_command' -a enable -d 'Enable the systemd unit for a profile' +complete -f -c netctl -n '__fish_netctl_using_command enable' -a '(__fish_netctl_get_profiles)' -d 'Profile' + +complete -f -c netctl -n '__fish_netctl_needs_command' -a disable -d 'Disable the systemd unit for a profile' +complete -f -c netctl -n '__fish_netctl_using_command disable' -a '(__fish_netctl_get_profiles)' -d 'Profile' + +complete -f -c netctl -n '__fish_netctl_needs_command' -a reenable -d 'Reenable the systemd unit for a profile' +complete -f -c netctl -n '__fish_netctl_using_command reenable' -a '(__fish_netctl_get_profiles)' -d 'Profile' |