add completion for bkp, add func destroy
This commit is contained in:
parent
350a359175
commit
fbe1ac82f1
@ -7,6 +7,15 @@ _ssh() {
|
||||
return 0
|
||||
}
|
||||
|
||||
_bkp() {
|
||||
local cur opts
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
opts=$(ls ~/.backup/1)
|
||||
COMPREPLY=( $(compgen -W "$opts" -- ${cur}) )
|
||||
return 0
|
||||
}
|
||||
|
||||
_workon() {
|
||||
local cur prev envs
|
||||
COMPREPLY=()
|
||||
@ -20,4 +29,5 @@ _workon() {
|
||||
complete -F _workon workon
|
||||
complete -F _ssh ssh
|
||||
complete -F _ssh sftp
|
||||
complete -F _bkp bkp
|
||||
|
||||
|
||||
@ -1,4 +1,14 @@
|
||||
|
||||
|
||||
destroy() {
|
||||
test -n "$1" || return 1
|
||||
test -e "$1" || return 1
|
||||
|
||||
echo "Sure want to destroy file '$1' with size $(du -hs "$1" | awk '{printf $1}') [y/N] "
|
||||
read -r response
|
||||
[[ $response == [yY] ]] && shred -zun 25 "$1"
|
||||
}
|
||||
|
||||
lsl () {
|
||||
|
||||
local DIR
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user