mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
5ca63c4956
Two useless forks plus one per element in $dirstack.
15 lines
383 B
Fish
15 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
|