Skip to content

Commit

Permalink
Fix completion for >=zsh-5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
vaeth committed Jan 7, 2017
1 parent c5b9588 commit 4e2e5a3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion bin/squashmount
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env perl
BEGIN { require 5.022 }
package Squashmount v15.4.0;
package Squashmount v15.4.1;

use strict;
use warnings;
Expand Down
11 changes: 4 additions & 7 deletions zsh/_squashmount
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#compdef squashmount
local curcontext="$curcontext" state state_descr line
typeset -A opt_args
_arguments -C -s -S -A '-*' : \
_arguments -C -s -S : \
'(* -)'{'--help','-h'}'[print a brief help]' \
'(* -)'{'--man','-\\?'}'[show extended help as a manpage]' \
'(* -)'{'--version','-V'}'[print version and exit]' \
Expand Down Expand Up @@ -87,8 +87,7 @@ case $state in
'print-threshold:print active threshold value'
'print-kill:print 1 is --kill is active'
)
_describe -t commands 'command' cmds
ret=$?;;
_describe -t commands 'command' cmds && ret=0;;
(mask)
local expl
if [[ -z ${opt_args[--pass-dir]++} ]]
Expand All @@ -98,12 +97,10 @@ case $state in
masks=(${(f)"$(_call_program print-masks 'squashmount --no-locking -q print-tag 2>/dev/null')"})
_description masks expl 'mask'
compadd "$expl[@]" - $masks
ret=?
}
} && ret=0
else local paths
paths=(${(f)"$(_call_program print-dirs 'squashmount --no-locking -q print-dir 2>/dev/null')"})
_canonical_paths -A paths directories 'mount point'
ret=$?
_canonical_paths -A paths directories 'mount point' && ret=0
fi;;
esac
return ret

0 comments on commit 4e2e5a3

Please sign in to comment.