completions: add basic completions for udevil

Add a set of basic completions for udevil, which is a program that
allows unpriviledged users to mount devices.

Each command has a corresponding long-option-like syntax variant
(sometimes even multiple ones), such as "udevil monitor" -> "udevil
--monitor", which are omitted here for simplicity.

The project unfortunately seems long abandoned and as such no attempt to
submit these completions upstream has been made.
This commit is contained in:
Karel Balej
2025-09-22 11:17:28 +02:00
committed by Johannes Altmanninger
parent 22ffc31b71
commit 3d5a5b8740

View File

@@ -0,0 +1,10 @@
set -l __fish_udevil_commands mount unmount umount clean monitor help info
complete -c udevil -f
complete -c udevil -n "not __fish_seen_subcommand_from $__fish_udevil_commands" -a "$__fish_udevil_commands"
complete -c udevil -n "not __fish_seen_subcommand_from $__fish_udevil_commands" -l verbose -l quiet
complete -c udevil -n "__fish_seen_subcommand_from mount" -a "(__fish_complete_blockdevice)" -F
complete -c udevil -n "__fish_seen_subcommand_from mount" -x -o t -a "(__fish_print_filesystems)"
complete -c udevil -n "__fish_seen_subcommand_from mount" -x -o o -a "(__fish_complete_mount_opts)"
complete -c udevil -n "__fish_seen_subcommand_from umount unmount" -a "(__fish_print_mounted)"
complete -c udevil -n "__fish_seen_subcommand_from umount unmount" -o l -o f
complete -c udevil -n "__fish_seen_subcommand_from info" -a "(__fish_complete_blockdevice)"