aboutsummaryrefslogtreecommitdiff
path: root/bin/bins
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2022-11-12 07:33:36 -0300
committerEuAndreh <eu@euandre.org>2022-11-12 07:33:36 -0300
commit908ab441cc95d7ac657bf285dbe63a4c270ec841 (patch)
tree28052fc41a99c13e0abd4f1fe0dbb84b87ded29e /bin/bins
parentMove email, IRC and Atom into Thunderbird (diff)
downloaddotfiles-908ab441cc95d7ac657bf285dbe63a4c270ec841.tar.gz
dotfiles-908ab441cc95d7ac657bf285dbe63a4c270ec841.tar.xz
bin/bins: Add -F option
Diffstat (limited to 'bin/bins')
-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: