diff options
author | Clément Martinez <clementmartinezdev@gmail.com> | 2016-06-07 16:50:28 +0200 |
---|---|---|
committer | Clément Martinez <clementmartinezdev@gmail.com> | 2016-06-07 16:50:28 +0200 |
commit | 913624cbfac4f1b3dd90f47c7645c3977dc511ff (patch) | |
tree | 9d5ce142432dacc63e6ab1d8f01995f2576c21bd /share/completions/netctl-auto.fish | |
parent | 220fd418a7d1459f467eefaa09928063bdb515f3 (diff) |
Add netctl-auto autocomplete
Diffstat (limited to 'share/completions/netctl-auto.fish')
-rw-r--r-- | share/completions/netctl-auto.fish | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/share/completions/netctl-auto.fish b/share/completions/netctl-auto.fish new file mode 100644 index 00000000..034c1642 --- /dev/null +++ b/share/completions/netctl-auto.fish @@ -0,0 +1,33 @@ +set -l cmds list store restore stop-all start stop restart switch-to status enable disable reenable is-enabled edit + +function __fish_print_netctl-auto_profile + for line in (netctl-auto list) + set -l profile (string sub -s 3 $line) + if [ (string sub -l 1 $line) = "*" ] + printf "%s\t%s\n" $profile "Active profile" + else + printf "%s\t%s\n" $profile "Profile" + end + end +end + +complete -c netctl-auto -n "not __fish_seen_subcommand_from $cmds" -l help -d "Show help" +complete -c netctl-auto -n "not __fish_seen_subcommand_from $cmds" -l version -d "Show version" + +complete -c netctl-auto -n "not __fish_seen_subcommand_from $cmds" -a list -f -d "List all available profiles" +complete -c netctl-auto -n "not __fish_seen_subcommand_from $cmds" -a store -f -d "Save the profiles that are currently active" +complete -c netctl-auto -n "not __fish_seen_subcommand_from $cmds" -a restore -f -d "Load the profiles that were active during the last invocation of 'store'" +complete -c netctl-auto -n "not __fish_seen_subcommand_from $cmds" -a stop-all -f -d "Stop all active network profiles" +complete -c netctl-auto -n "not __fish_seen_subcommand_from $cmds" -a start -f -d "Start network profile" +complete -c netctl-auto -n "not __fish_seen_subcommand_from $cmds" -a stop -f -d "Stop network profile" +complete -c netctl-auto -n "not __fish_seen_subcommand_from $cmds" -a restart -f -d "Restart network profile" +complete -c netctl-auto -n "not __fish_seen_subcommand_from $cmds" -a switch-to -f -d "Start profile after stopping the others that refer to the same interface" +complete -c netctl-auto -n "not __fish_seen_subcommand_from $cmds" -a status -f -d "Show terse runtime status inforamation about a profile" +complete -c netctl-auto -n "not __fish_seen_subcommand_from $cmds" -a enable -f -d "Enable the systemd unit for the specified profile" +complete -c netctl-auto -n "not __fish_seen_subcommand_from $cmds" -a disable -f -d "Disable the systemd unit for the specified profile" +complete -c netctl-auto -n "not __fish_seen_subcommand_from $cmds" -a reenable -f -d "Renable the systemd unit for the specified profile" +complete -c netctl-auto -n "not __fish_seen_subcommand_from $cmds" -a is-enabled -f -d "Check whether the systemd unit for the specified profile is enabled" +complete -c netctl-auto -n "not __fish_seen_subcommand_from $cmds" -a edit -f -d "Open the file of the specified profile in an editor" + +complete -c netctl-auto -n "__fish_seen_subcommand_from start stop restart switch-to status enable disable reenable is-enabled edit" -f -a "(__fish_print_netctl-auto_profile)" -d "Profile" + |