aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/completions
diff options
context:
space:
mode:
authorGravatar Fabian Homborg <FHomborg@gmail.com>2016-05-19 14:50:25 +0200
committerGravatar Fabian Homborg <FHomborg@gmail.com>2016-05-19 14:50:25 +0200
commita0b3b8ac4c010e47197c7d4a4a9627337255707e (patch)
tree5331e37d4b2ec36813e648bd083e3232df1d5c6c /share/completions
parent4d63ebde15567a0af57835b4e12058c3fc0040e6 (diff)
Add networkctl completion
Very simple, but effective.
Diffstat (limited to 'share/completions')
-rw-r--r--share/completions/networkctl.fish5
1 files changed, 5 insertions, 0 deletions
diff --git a/share/completions/networkctl.fish b/share/completions/networkctl.fish
new file mode 100644
index 00000000..370fb626
--- /dev/null
+++ b/share/completions/networkctl.fish
@@ -0,0 +1,5 @@
+set -l cmds status list lldp
+
+complete -c networkctl -f -n '__fish_seen_subcommand_from status' -a '(networkctl list --no-pager --no-legend -a | string trim \
+| string replace -r \'([0-9]+) (\w+) .*$\' \'$2\t$1\n$1\t$2\')'
+complete -c networkctl -x -n "not __fish_seen_subcommand_from $cmds" -a "$cmds"