mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2024-12-03 14:53:41 +08:00
13 lines
250 B
Fish
13 lines
250 B
Fish
function __bak_name
|
|
# trim / for directories
|
|
set arg (echo $argv[1] | sed "s/\///")
|
|
echo "$arg.(date +"%Y%m%d_%H%M%S").bak"
|
|
end
|
|
|
|
function __bak
|
|
set program $argv[1]
|
|
for arg in $argv[2..-1]
|
|
eval $program $arg (__bak_name $arg)
|
|
end
|
|
end
|