danix
's git repository
home
/
my projects
/
bash-notes.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fb71118
)
removed conditional that printed the helptext after every command
author
danix
<danix@danix.xyz>
Wed, 29 Mar 2023 09:51:37 +0000
(11:51 +0200)
committer
danix
<danix@danix.xyz>
Wed, 29 Mar 2023 09:51:37 +0000
(11:51 +0200)
SOURCE/main.sh
patch
|
blob
|
blame
|
history
notes.sh
patch
|
blob
|
blame
|
history
diff --git
a/SOURCE/main.sh
b/SOURCE/main.sh
index
da3130a
..
94f696d
100644
(file)
--- a/
SOURCE/main.sh
+++ b/
SOURCE/main.sh
@@
-37,6
+37,7
@@
while true; do
esac
shift 2
addnote "$TITLE"
+ exit
;;
-e | --edit )
case "$2" in
@@
-49,6
+50,7
@@
while true; do
esac
shift 2
editnote "$NOTE"
+ exit
;;
-d | --delete )
case "$2" in
@@
-61,6
+63,7
@@
while true; do
esac
shift 2
rmnote "$NOTE"
+ exit
;;
-s | --show )
case "$2" in
@@
-73,6
+76,7
@@
while true; do
esac
shift 2
shownote "$NOTE"
+ exit
;;
--userconf )
export_config
@@
-90,7
+94,3
@@
while true; do
;;
esac
done
-
-if [ -z $1 ]; then
- helptext
-fi
diff --git
a/notes.sh
b/notes.sh
index
5d7ae7e
..
b298cff
100755
(executable)
--- a/
notes.sh
+++ b/
notes.sh
@@
-236,6
+236,7
@@
function editnote() {
echo "note not found"
exit 1
fi
+ exit
}
function listnotes() {
# [ $PLAIN == true ] && echo "output is plain text" || echo "output is colored"
@@
-366,6
+367,7
@@
while true; do
esac
shift 2
addnote "$TITLE"
+ exit
;;
-e | --edit )
case "$2" in
@@
-378,6
+380,7
@@
while true; do
esac
shift 2
editnote "$NOTE"
+ exit
;;
-d | --delete )
case "$2" in
@@
-390,6
+393,7
@@
while true; do
esac
shift 2
rmnote "$NOTE"
+ exit
;;
-s | --show )
case "$2" in
@@
-402,6
+406,7
@@
while true; do
esac
shift 2
shownote "$NOTE"
+ exit
;;
--userconf )
export_config
@@
-419,7
+424,3
@@
while true; do
;;
esac
done
-
-if [ -z $1 ]; then
- helptext
-fi