Add status dirname and status basename convenience commands

There's a terrible number of fishscripts that start with

    set path (dirname (status filename))

And that's really just a bit boring.

So let's let it be

    set path (status dirname)
This commit is contained in:
Fabian Homborg
2020-06-01 16:46:20 +02:00
parent af2d19bde0
commit 44184f68e4
3 changed files with 40 additions and 5 deletions

View File

@@ -36,3 +36,18 @@ echo $status
echo (status is-command-substitution; echo $status)
# CHECK: 1
# CHECK: 0
test (status filename) = (status dirname)/(status basename)
status basename
#CHECK: status-command.fish
status dirname | string match -q '*checks'
echo $status
#CHECK: 0
echo "status dirname" | source
#CHECK: .
$FISH_PATH -c 'status dirname'
#CHECK: Standard input