Skip to content

Commit

Permalink
Edit: Fix Options
Browse files Browse the repository at this point in the history
  • Loading branch information
zakariagatter committed Aug 11, 2022
1 parent 60351f7 commit 9e74c90
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions bin/brash
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ main_func(){
while [ "$1" ]; do
case "$1" in
-d ) options[d]=true
until [[ $2 =~ ^-[dlrzciIvh]$ ]] || [[ -z "$2" ]] ; do
until [[ $2 =~ ^-[dlrcsiIvhV]$ ]] || [[ -z "$2" ]] ; do
ListFiles+=( "$2" )
shift
done
Expand All @@ -407,7 +407,7 @@ while [ "$1" ]; do
[ "$3" ] || die "Option require a argument -- 'file'.\nTry '$name -h' for more informations."
FileList=true
shift
until [[ $2 =~ ^-[dlrzciIvh]$ ]] || [[ -z "$2" ]] ; do
until [[ $2 =~ ^-[dlrcsiIvhV]$ ]] || [[ -z "$2" ]] ; do
ListFiles+=( "$2" )
shift
done
Expand All @@ -425,7 +425,7 @@ while [ "$1" ]; do
[ "$3" ] || die "Option require a argument -- 'file'.\nTry '$name -h' for more informations."
FileRestore=true
shift
until [[ $2 =~ ^-[dlrzciIvh]$ ]] || [[ -z "$2" ]] ; do
until [[ $2 =~ ^-[dlrcsiIvhV]$ ]] || [[ -z "$2" ]] ; do
ListFiles+=( "$2" )
shift
done
Expand All @@ -443,7 +443,7 @@ while [ "$1" ]; do
[ "$3" ] || die "Option require a argument -- 'file'.\nTry '$name -h' for more informations."
FileClean=true
shift
until [[ $2 =~ ^-[dlrzciIvh]$ ]] || [[ -z "$2" ]] ; do
until [[ $2 =~ ^-[dlrcsiIvhV]$ ]] || [[ -z "$2" ]] ; do
ListFiles+=( "$2" )
shift
done
Expand Down Expand Up @@ -479,4 +479,4 @@ main_func "$@"
[ -z "${options[c]}" ] || clean_func
[ -z "${options[s]}" ] || size_func
[ -z "${options[h]}" ] || help_func
[ -z "${options[V]}" ] || printf "%s\n" "${name^} Version: $VERSION"
[ -z "${options[V]}" ] || printf "%s\n" "${name^} Version: $VERSION (MIT Licence)"

0 comments on commit 9e74c90

Please sign in to comment.