mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-30 03:01:15 -03:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user