safe status
This commit is contained in:
@@ -2,15 +2,28 @@
|
||||
|
||||
set -e
|
||||
function helpexit() {
|
||||
echo Delete files by moving to a safe location in your ~/.cache/rm-safe
|
||||
echo This command is always recursive!
|
||||
echo '-v verbose, --clear delete cache permanently'
|
||||
echo 'Delete files by moving to a safe in your ~/.cache/rm-safe
|
||||
This command is always recursive!
|
||||
|
||||
-v verbose
|
||||
--clear delete safe permanently
|
||||
--status view safe sizes
|
||||
'
|
||||
exit
|
||||
}
|
||||
function clearsafe() {
|
||||
test -d "$SAFELOC" && rm-progress -f "$SAFELOC"
|
||||
exit
|
||||
}
|
||||
function viewsafe() {
|
||||
test -d "$SAFELOC" && {
|
||||
for d in "$SAFELOC"/*; do
|
||||
printf "%s\t" "$d"
|
||||
fastdu -h -s "$d"
|
||||
done
|
||||
}
|
||||
exit
|
||||
}
|
||||
SAFELOC=~/.cache/rm-safe
|
||||
FOLDERS=()
|
||||
QUIET="-q"
|
||||
@@ -20,6 +33,7 @@ for ((i=1; i<=${#@}; i++)) {
|
||||
[[ "${!i}" = "--help" ]] && helpexit
|
||||
[[ "${!i}" = "-v" ]] && { VERBOSE=1; QUIET=""; continue; }
|
||||
[[ "${!i}" = "--clear" ]] && { clearsafe; continue; }
|
||||
[[ "${!i}" = "--status" ]] && { viewsafe; continue; }
|
||||
[[ "${!i}" = "-"* ]] && helpexit
|
||||
FOLDERS+=( "${!i}" )
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user