From df43e926ab1a0c4ca6547fdd4c1a4dec14317f4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dylan=20G=C3=B6pel?= Date: Fri, 12 Jul 2019 19:27:14 +0200 Subject: [PATCH 1/2] fix no-topic edit bug --- memo | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/memo b/memo index d202297..c201fcb 100755 --- a/memo +++ b/memo @@ -106,6 +106,12 @@ function remove_topic (){ function edit_topic () { topic_name=$1 + if [[ -z $topic_name ]] + then + echo "you have to specify a topic" + exit 1 + fi + precondition:provide_topic ${topic_name} topic_path=${MEMO_FOLDER}/${topic_name} From 36f3dcd315634d4c55e95e9aef0d0593c0f17bbe Mon Sep 17 00:00:00 2001 From: Ingolf Wanger Date: Fri, 12 Jul 2019 19:37:21 +0200 Subject: [PATCH 2/2] updated man page --- doc/memo.1 | 86 +++++++++++++++++++++--------------------------------- 1 file changed, 33 insertions(+), 53 deletions(-) diff --git a/doc/memo.1 b/doc/memo.1 index cd3a139..8eb25fc 100644 --- a/doc/memo.1 +++ b/doc/memo.1 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pandoc 2.2.1 +.\" Automatically generated by Pandoc 2.7.1 .\" .TH "memo" "1" "10 August 2018" "doc" "Linux Reference Manual" .hy @@ -7,105 +7,85 @@ memo .SH SYNOPSIS .PP -\f[C]memo\ \ [arguments]\f[] +\f[C]memo [arguments]\f[R] .SH DESCRIPTION .PP A tool to memorize stuff. -It saves files \f[C]$MEMO_DIR\f[] (\f[C]$HOME/memo\f[] by default). -The structure is \f[C]$MEMO_DIR//memo.md\f[] You can also copy +It saves files \f[C]$MEMO_DIR\f[R] (\f[C]$HOME/memo\f[R] by default). +The structure is \f[C]$MEMO_DIR//memo.md\f[R] You can also copy files in the topic folder as well. .PP -We call the folder \f[C]$MEMO_DIR/\f[] a `topic folder'. +We call the folder \f[C]$MEMO_DIR/\f[R] a `topic folder'. .SH COMMANDS .TP -.B \f[C]add\ \ [text]\f[] -Adds text to the \f[C]memo.md\f[] in the topic folder. +.B \f[C]add [text]\f[R] +Adds text to the \f[C]memo.md\f[R] in the topic folder. If text is not given it will read from stdin. -.RS -.RE .TP -.B \f[C]rm\ \f[] -Remove \f[C]$MEMO_DIR/topic\f[] folder with all its content. -.RS -.RE +.B \f[C]rm \f[R] +Remove \f[C]$MEMO_DIR/topic\f[R] folder with all its content. .TP -.B \f[C]copy\ \ \f[] +.B \f[C]copy \f[R] Copy a file to the topic folder. -.RS -.RE .TP -.B \f[C]search\ \f[] -Search for a term in \f[C]$MEMO_DIR\f[] using \f[C]ack\f[]. -.RS -.RE +.B \f[C]search \f[R] +Search for a term in \f[C]$MEMO_DIR\f[R] using \f[C]ack\f[R]. .TP -.B \f[C]show\ \f[] -Shows \f[C]memo.md\f[] in the topic folder. +.B \f[C]show \f[R] +Shows \f[C]memo.md\f[R] in the topic folder. Also shows a list of all files in the topic folder. -.RS -.RE .TP -.B \f[C]edit\ \f[] +.B \f[C]edit \f[R] Opens your favorite editor to edit the memo topic. -.RS -.RE .TP -.B \f[C]list\f[] +.B \f[C]list\f[R] Prints a list of all topics. -.RS -.RE .TP -.B \f[C]git\ \f[] -Run a git command in \f[C]$MEMO_DIR\f[]. -Once \f[C]$MEMO_DIR\f[] is a git repository, all memo commands create +.B \f[C]git \f[R] +Run a git command in \f[C]$MEMO_DIR\f[R]. +Once \f[C]$MEMO_DIR\f[R] is a git repository, all memo commands create commits. -.RS -.RE .SH CONFIGURATION .TP -.B \f[C]$MEMO_DIR\f[] +.B \f[C]$MEMO_DIR\f[R] holds the folder where to store the memo files. -Default is \f[C]$HOME/memo\f[]. -.RS -.RE +Default is \f[C]$HOME/memo\f[R]. .TP -.B \f[C]$EDITOR\f[] +.B \f[C]$EDITOR\f[R] Your favorite editor. Must be set for the edit command. -.RS -.RE .SH EXAMPLE .PP -Append the string \[lq]A search\-engine\[rq] to the \f[C]memo.md\f[] +Append the string \[lq]A search-engine\[rq] to the \f[C]memo.md\f[R] file in the topic \[lq]google\[rq]. .IP .nf \f[C] -$\ memo\ add\ google\ A\ search\-engine -\f[] +$ memo add google A search-engine +\f[R] .fi .PP -Appends the content of \f[C]www.google.com\f[] to the \f[C]memo.md\f[] +Appends the content of \f[C]www.google.com\f[R] to the \f[C]memo.md\f[R] file the topic \[lq]google\[rq]. .IP .nf \f[C] -$\ curl\ www.google.com\ |\ memo\ add\ google -\f[] +$ curl www.google.com | memo add google +\f[R] .fi .PP Copy the \[lq]Invoice.pdf\[rq] file to the \[lq]lawsuit\[rq] topic. .IP .nf \f[C] -$\ memo\ copy\ lawsuit\ ~/Downloads/Invoice.pdf -\f[] +$ memo copy lawsuit \[ti]/Downloads/Invoice.pdf +\f[R] .fi .PP -Make \f[C]$MEMO_DIR\f[] a git repository. +Make \f[C]$MEMO_DIR\f[R] a git repository. .IP .nf \f[C] -$\ memo\ git\ init -\f[] +$ memo git init +\f[R] .fi