aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/bins12
1 files changed, 10 insertions, 2 deletions
diff --git a/bin/bins b/bin/bins
index 1b28089..9f869de 100755
--- a/bin/bins
+++ b/bin/bins
@@ -4,7 +4,7 @@ set -eu
usage() {
cat <<-'EOF'
Usage:
- bins
+ bins [-F]
bins -h
EOF
}
@@ -13,6 +13,7 @@ help() {
cat <<-'EOF'
Options:
+ -F force remove the cache file
-h, --help show this message
@@ -45,8 +46,12 @@ for flag in "$@"; do
esac
done
-while getopts 'h' flag; do
+FORCE=false
+while getopts 'Fh' flag; do
case "$flag" in
+ F)
+ FORCE=true
+ ;;
h)
usage
help
@@ -62,6 +67,9 @@ shift $((OPTIND- 1))
F="$XDG_CACHE_HOME/euandreh/bins"
+if [ "$FORCE" = true ]; then
+ rm -f "$F"
+fi
IFS=:
# Word-splitting is the goal: