mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-26 11:45:08 +00:00
convert dirh
to use argparse
This commit is contained in:
parent
f156bea1b7
commit
30baf8d101
1 changed files with 7 additions and 7 deletions
|
@ -1,10 +1,11 @@
|
||||||
function dirh --description "Print the current directory history (the prev and next lists)"
|
function dirh --description "Print the current directory history (the prev and next lists)"
|
||||||
if set -q argv[1]
|
set -l options 'h/help'
|
||||||
switch $argv[1]
|
argparse -n dirh --max-args=0 $options -- $argv
|
||||||
case -h --h --he --hel --help
|
or return
|
||||||
__fish_print_help dirh
|
|
||||||
return 0
|
if set -q _flag_help
|
||||||
end
|
__fish_print_help dirh
|
||||||
|
return 0
|
||||||
end
|
end
|
||||||
|
|
||||||
set -l dirc (count $dirprev)
|
set -l dirc (count $dirprev)
|
||||||
|
@ -25,6 +26,5 @@ function dirh --description "Print the current directory history (the prev and n
|
||||||
printf '%2d) %s\n' $i $dirnext[$i]
|
printf '%2d) %s\n' $i $dirnext[$i]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
echo
|
echo
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue