fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
a53db7256
master
1# localization: skip(private) 2# Generates a list of parent directories for a given path 3# i.e. /a/b/c/d -> [/a/b/c/, /a/b/, /a/, and /a] 4function __fish_parent_directories 5if test ( count $argv ) -ne 1 6# for use in completions, so don't spew error messages 7return 1 8end 9 10set -l splits( string split'/' $argv [ 1 ]) 11set -l parents 12 13for splitin $splits 14if test ( string length" $split " ) -eq 0 15continue 16end 17 18set parents" $parents [ 1 ] / $split " $parents 19end 20 21for parentin $parents 22echo $parent 23end 24 25return 0 26end