]> git.rmz.io Git - dotfiles.git/commitdiff
zsh: run-help for btrfs
authorSamir Benmendil <me@rmz.io>
Thu, 27 Dec 2018 16:01:43 +0000 (16:01 +0000)
committerSamir Benmendil <me@rmz.io>
Thu, 27 Dec 2018 16:02:10 +0000 (16:02 +0000)
This file has been submitted upstream -> delete when merged

zsh/functions/run-help-btrfs [new file with mode: 0644]

diff --git a/zsh/functions/run-help-btrfs b/zsh/functions/run-help-btrfs
new file mode 100644 (file)
index 0000000..d9e3530
--- /dev/null
@@ -0,0 +1,31 @@
+if [ $# -eq 0 ]; then
+    man btrfs
+    return
+fi
+
+while [[ $# != 0 && $1 == -* ]]; do
+    shift
+done
+
+case $1 in
+    (b*)    man btrfs-balance          ;;
+    (c*)    man btrfs-check            ;;
+    (d*)    man btrfs-device           ;;
+    (f*)    man btrfs-filesystem       ;;
+    (i*)    man btrfs-image            ;;
+    (i*)    man btrfs-inspect-internal ;;
+    (m*)    man btrfs-map-logical      ;;
+    (p*)    man btrfs-property         ;;
+    (q*)    man btrfs-qgroup           ;;
+    (q*)    man btrfs-quota            ;;
+    (rec*)  man btrfs-receive          ;;
+    (rep*)  man btrfs-replace          ;;
+    (resc*) man btrfs-rescue           ;;
+    (rest*) man btrfs-restore          ;;
+    (sc*)   man btrfs-scrub            ;;
+    (se*)   man btrfs-send             ;;
+    (su*)   man btrfs-subvolume        ;;
+    (*)     man btrfs                  ;;
+esac
+
+return $?