mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2025-02-24 00:47:40 +08:00
Merge pull request #153 from oh-my-fish/remove-basename
Remove `basename` from core library
This commit is contained in:
commit
75937f6820
@ -39,10 +39,6 @@ if available battery
|
|||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
|
||||||
#### `basename` _`<path> ...`_
|
|
||||||
|
|
||||||
Wrap basename so it can handle multiple arguments.
|
|
||||||
|
|
||||||
#### `refresh`
|
#### `refresh`
|
||||||
|
|
||||||
Replace the running instance of fishshell with a new one causing Oh My Fish to reload as well.
|
Replace the running instance of fishshell with a new one causing Oh My Fish to reload as well.
|
||||||
|
@ -1,25 +0,0 @@
|
|||||||
# SYNOPSIS
|
|
||||||
# basename <string> [suffix]
|
|
||||||
# basename [-s suffix] <string> [string...]
|
|
||||||
#
|
|
||||||
# OVERVIEW
|
|
||||||
# variable arguments basename
|
|
||||||
|
|
||||||
function basename -d "get the filename or directory part of a path"
|
|
||||||
if set -q argv[1]
|
|
||||||
set -l ext ""
|
|
||||||
switch $argv[1]
|
|
||||||
case -s
|
|
||||||
if test (count $argv) -gt 2
|
|
||||||
set ext $argv[2]
|
|
||||||
set argv $argv[3..-1]
|
|
||||||
else
|
|
||||||
echo "basename: Invalid number of arguments"
|
|
||||||
return 1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
for path in $argv
|
|
||||||
command basename "$path" "$ext"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
Loading…
x
Reference in New Issue
Block a user