Skip to content

Commit 5fcfa55

Browse files
author
Nhoya
committed
-r option is more safe
1 parent fef8843 commit 5fcfa55

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

z0r

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,16 @@ checkdep(){
131131
fi
132132
done
133133
}
134-
134+
del_history(){
135+
echo -e $RED"Are you sure? History can not be restored [y/n]"$FINE
136+
read input
137+
case $input in
138+
[Yy]) echo "" > $LOGDIR
139+
;;
140+
*) exit 0
141+
;;
142+
esac
143+
}
135144
#option parser
136145
opsparser(){
137146
while getopts ":hvlrde:c:m:" opt; do
@@ -164,7 +173,7 @@ while getopts ":hvlrde:c:m:" opt; do
164173
echo -e $GREEN"======================================================================================================="$FINE
165174
exit 0
166175
;;
167-
r) echo "" > $LOGDIR
176+
r) del_history
168177
exit 0
169178
;;
170179
\?) echo -e $RED"enter a valid option, use -h for help"$FINE

0 commit comments

Comments
 (0)