mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-23 17:06:59 +08:00
5ca63c4956
Two useless forks plus one per element in $dirstack.
16 lines
383 B
Fish
16 lines
383 B
Fish
function dirs --description 'Print directory stack'
|
|
# process options
|
|
if set -q argv[1]
|
|
switch $argv[1]
|
|
case -c
|
|
# clear directory stack
|
|
set -e -g dirstack
|
|
return 0
|
|
end
|
|
end
|
|
|
|
# replace $HOME with ~
|
|
string replace -r '^'"$HOME"'($|/)' '~$1' -- $PWD $dirstack | string join " "
|
|
echo
|
|
end
|