fork/fish-shell

git clone https://git.julia.blue/fork/fish-shell

Johannes AltmanningerPrepare to not localize private function descriptionsd835c5252

master
486 B21 linesraw
1# localization: tier1
2function dirs --description 'Print directory stack'
3    set -l options h/help c
4    argparse -n dirs --max-args=0 $options -- $argv
5    or return
6
7    if set -q _flag_help
8        __fish_print_help dirs
9        return 0
10    end
11
12    if set -q _flag_c
13        # Clear directory stack.
14        set -e -g dirstack
15        return 0
16    end
17
18    # Replace $HOME with ~.
19    string replace -r '^'"$HOME"'($|/)' '~$1' -- $PWD $dirstack | string join " "
20    return 0
21end