mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-26 11:45:08 +00:00
update prompt_pwd
to use argparse
This commit is contained in:
parent
51a52a7286
commit
30940916bd
1 changed files with 7 additions and 5 deletions
|
@ -1,9 +1,11 @@
|
||||||
function prompt_pwd --description "Print the current working directory, shortened to fit the prompt"
|
function prompt_pwd --description "Print the current working directory, shortened to fit the prompt"
|
||||||
set -q argv[1]
|
set -l options 'h/help'
|
||||||
and switch $argv[1]
|
argparse -n prompt_pwd --max-args=0 $options -- $argv
|
||||||
case -h --help
|
or return
|
||||||
__fish_print_help prompt_pwd
|
|
||||||
return 0
|
if set -q _flag_help
|
||||||
|
__fish_print_help prompt_pwd
|
||||||
|
return 0
|
||||||
end
|
end
|
||||||
|
|
||||||
# This allows overriding fish_prompt_pwd_dir_length from the outside (global or universal) without leaking it
|
# This allows overriding fish_prompt_pwd_dir_length from the outside (global or universal) without leaking it
|
||||||
|
|
Loading…
Reference in a new issue