Commit a580f609 authored by Jérome Perrin's avatar Jérome Perrin

complete: completions for --only-sr and --only-cp

For fish shell, make slapos node software --only-sr and slapos node instance
--only-cp complete the software and partitions from the local slap proxy
parent 0b6bf2af
Pipeline #19025 running with stage
in 0 seconds
......@@ -97,6 +97,18 @@ function __fish_print_slapos_services
eval ( commandline -o | head -1 ) node supervisorctl status | sed -e 's/ /\t/'
end
# complete installed softwares for slapos node software --only-sr
function __fish_print_slapos_softwares
eval ( commandline -o | head -1 ) proxy show --software | tail -n +6 | grep available | awk '{print $4"\\t"$1}'
end
complete -c slapos -n '__fish_seen_subcommand_from node; and __fish_seen_subcommand_from software; and __fish_contains_opt only-sr only' -f -a '(__fish_print_slapos_softwares)'
# complete busy partitions for slapos node instance --only-cp
function __fish_print_slapos_partitions
eval ( commandline -o | head -1 ) proxy show --partitions | tail -n +6 | grep busy | awk '{print $1"\\t"$6" "$5" "$4}'
end
complete -c slapos -n '__fish_seen_subcommand_from node; and __fish_seen_subcommand_from instance; and __fish_contains_opt only-cp only' -f -a '(__fish_print_slapos_partitions)'
""")
self.app.stdout.write("# all subcommands\n")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment