Introduction
Introduction Statistics Contact Development Disclaimer Help
add edit command back for special cases - notes - a console notes manager using…
Log
Files
Refs
Tags
LICENSE
---
commit b048880ad42ba99c6e5cba227505724d3b501ad2
parent 901af4715f8b6dd389b9d047a4ff15e769b61723
Author: Solene Rapenne <[email protected]>
Date: Sat, 14 Jul 2018 11:17:16 +0200
add edit command back for special cases
Diffstat:
M notes | 26 ++++++++++++++------------
1 file changed, 14 insertions(+), 12 deletions(-)
---
diff --git a/notes b/notes
@@ -34,7 +34,7 @@ usage() {
': output content of the file' \
"$name rm PATH" \
': delete file' \
- "$name PATH" \
+ "$name [edit] PATH" \
": start \$EDITOR ($EDITOR) on file and auto commit"
}
@@ -128,19 +128,21 @@ then
exit 2
fi
-if [ -f "$REPO/$1" ]; then
- edit "$1"
- exit 0
-fi
-
case "$1" in
- '') display ;;
- "ls") display ;;
- "i*") initialization ;;
+ '') display ;;
+ "ls") display ;;
+ "i*") initialization ;;
"la*") last ;;
+ "e*") [ -n "$2" ] && edit "$2" ;;
"hi*") [ -n "$2" ] && histo "$2" ;;
- "c*") [ -n "$2" ] && show_file "$2" ;;
- "r*") [ -n "$2" ] && delete "$2" ;;
+ "c*") [ -n "$2" ] && show_file "$2" ;;
+ "r*") [ -n "$2" ] && delete "$2" ;;
"_files") _completion_list ;;
- *) usage && exit 1 ;;
esac
+
+if [ -f "$REPO/$1" ]; then
+ edit "$1"
+ exit 0
+fi
+
+usage && exit 1
You are viewing proxied material from bitreich.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.