From 8a4ee02d2426d304f89f8882a75a7c9463dedc54 Mon Sep 17 00:00:00 2001 From: NextAlone <12210746+NextAlone@users.noreply.github.com> Date: Wed, 27 Apr 2022 03:11:54 +0800 Subject: [PATCH] feat: more completion for umount (#8908) * feat: more completion for umount * feat: add btrfs to known filesystems --- share/completions/umount.fish | 14 +++++++++----- share/functions/__fish_print_filesystems.fish | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/share/completions/umount.fish b/share/completions/umount.fish index f15d0ba3e..7c44fae5b 100644 --- a/share/completions/umount.fish +++ b/share/completions/umount.fish @@ -7,15 +7,19 @@ # complete -c umount -d "Mount point" -x -a '(__fish_print_mounted)' -complete -c umount -s V -l version -d "Display version and exit" -complete -c umount -s h -l help -d "Display help and exit" -complete -c umount -s v -l verbose -d "Verbose mode" -complete -c umount -s n -l no-mtab -d "Unmount without writing in /etc/mtab" +complete -c umount -s V -l version -d "Display version" +complete -c umount -s h -l help -d "Display help" +complete -c umount -s v -l verbose -d "Say what is being done" +complete -c umount -s n -l no-mtab -d "Don't write to /etc/mtab" complete -c umount -s r -l read-only -d "In case unmounting fails, try to remount read-only" complete -c umount -s d -l detach-loop -d "In case the unmounted device was a loop device, also free this loop device" -complete -c umount -s i -l internal-only -d "Don't call the /sbin/umount. helper even if it exists" +complete -c umount -s i -l internal-only -d "Don't call the umount. helpers" complete -c umount -s a -l all -d "Unmount all of the file systems described in /etc/mtab" complete -c umount -s t -l types -d "Actions should only be taken on file systems of the specified type" -xa "(__fish_print_filesystems)" complete -c umount -s O -l test-opts -d "Actions should only be taken on file systems with the specified options in /etc/fstab" -xa '(cut -d " " -f 4 /etc/mtab)\t"Mount option"' complete -c umount -s f -l force -d "Force unmount (in case of an unreachable NFS system)" complete -c umount -s l -l lazy -d "Lazy unmount (unmount a 'busy' filesystem)" +complete -c umount -s R -l recursive -d "Recursively unmount a target with all its children" +complete -c umount -s A -l all-targets -d "Unmount all mountpoints for the given device in the current namespaces" +complete -c umount -s c -l no-canonicalize -d "Don't canonicalize paths" +complete -c umount -l fake -d "dry run; skip the umount(2) syscall" diff --git a/share/functions/__fish_print_filesystems.fish b/share/functions/__fish_print_filesystems.fish index 7d86b88f4..0d5266de4 100644 --- a/share/functions/__fish_print_filesystems.fish +++ b/share/functions/__fish_print_filesystems.fish @@ -1,5 +1,5 @@ function __fish_print_filesystems -d "Print a list of all known filesystem types" - set -l fs adfs affs autofs coda coherent cramfs devpts efs ext ext2 ext3 ffs + set -l fs adfs affs autofs btrfs coda coherent cramfs devpts efs ext ext2 ext3 ffs set -a fs hfs hpfs iso9660 jfs minix msdos ncpfs nfs ntfs proc qnx4 ramfs set -a fs reiserfs romfs smbfs sysv tmpfs udf ufs umsdos vfat xenix xfs xiafs # Mount has helper binaries to mount filesystems