fork/fish-shell

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

Johannes AltmanningerMark private functions that don't need localizationa53db7256

master
736 B28 linesraw
1# localization: skip(private)
2function __fish_move_last -d "Move the last element of a directory history from src to dest"
3    set -l src $argv[1]
4    set -l dest $argv[2]
5
6    set -l size_src (count $$src)
7
8    if test $size_src = 0
9        # Cannot make this step
10        # Print a bel, which is the character to print for notifications like these.
11        printf \a
12        return 1
13    end
14
15    # Append current dir to the end of the destination
16    set -g (echo $dest) $$dest $PWD
17
18    set -l ssrc $$src
19
20    # Change dir to the last entry in the source dir-hist
21    builtin cd $ssrc[$size_src]
22
23    # Keep all but the last from the source dir-hist
24    set -e (echo $src)\[$size_src]
25
26    # All ok, return success
27    return 0
28end