aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/functions/__fish_print_commands.fish
diff options
context:
space:
mode:
authorGravatar Fabian Homborg <FHomborg@gmail.com>2016-06-10 14:13:15 +0200
committerGravatar Fabian Homborg <FHomborg@gmail.com>2016-06-10 14:13:15 +0200
commit222a07e907c239f7dab541512b109730a07828dc (patch)
treed492cd469bff2d285fd574200cc18d3d6bb78193 /share/functions/__fish_print_commands.fish
parent9d2092bf9fa65450bb8a021c4ecd42af1b7bf11b (diff)
Allow compressed man pages in `help`
It seems Fedora compresses our whopping 340k of man pages. Fixes #3130. Inspired by @TieDyedDevil's work there.
Diffstat (limited to 'share/functions/__fish_print_commands.fish')
-rw-r--r--share/functions/__fish_print_commands.fish8
1 files changed, 5 insertions, 3 deletions
diff --git a/share/functions/__fish_print_commands.fish b/share/functions/__fish_print_commands.fish
index 21c0876d..bac2bd73 100644
--- a/share/functions/__fish_print_commands.fish
+++ b/share/functions/__fish_print_commands.fish
@@ -1,5 +1,7 @@
function __fish_print_commands --description "Print a list of documented fish commands"
- if test -d $__fish_datadir/man/man1/
- find $__fish_datadir/man/man1/ -type f -name \*.1 -execdir basename '{}' .1 ';'
- end
+ if test -d $__fish_datadir/man/man1/
+ for file in $__fish_datadir/man/man1/**.1*
+ string replace -r '.*/' '' -- $file | string replace -r '.1(.gz)?$' ''
+ end
+ end
end