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