Merge branch 'release/0.8'

master 0.8
Ingolf Wanger 2019-07-12 19:37:30 +02:00
commit 58fd706c1d
2 changed files with 39 additions and 53 deletions

View File

@ -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" .TH "memo" "1" "10 August 2018" "doc" "Linux Reference Manual"
.hy .hy
@ -7,105 +7,85 @@
memo memo
.SH SYNOPSIS .SH SYNOPSIS
.PP .PP
\f[C]memo\ <command>\ [arguments]\f[] \f[C]memo <command> [arguments]\f[R]
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
A tool to memorize stuff. A tool to memorize stuff.
It saves files \f[C]$MEMO_DIR\f[] (\f[C]$HOME/memo\f[] by default). It saves files \f[C]$MEMO_DIR\f[R] (\f[C]$HOME/memo\f[R] by default).
The structure is \f[C]$MEMO_DIR/<topic>/memo.md\f[] You can also copy The structure is \f[C]$MEMO_DIR/<topic>/memo.md\f[R] You can also copy
files in the topic folder as well. files in the topic folder as well.
.PP .PP
We call the folder \f[C]$MEMO_DIR/<topic>\f[] a `topic folder'. We call the folder \f[C]$MEMO_DIR/<topic>\f[R] a `topic folder'.
.SH COMMANDS .SH COMMANDS
.TP .TP
.B \f[C]add\ <topic>\ [text]\f[] .B \f[C]add <topic> [text]\f[R]
Adds text to the \f[C]memo.md\f[] in the topic folder. Adds text to the \f[C]memo.md\f[R] in the topic folder.
If text is not given it will read from stdin. If text is not given it will read from stdin.
.RS
.RE
.TP .TP
.B \f[C]rm\ <topic>\f[] .B \f[C]rm <topic>\f[R]
Remove \f[C]$MEMO_DIR/topic\f[] folder with all its content. Remove \f[C]$MEMO_DIR/topic\f[R] folder with all its content.
.RS
.RE
.TP .TP
.B \f[C]copy\ <topic>\ <file\-to\-copy>\f[] .B \f[C]copy <topic> <file-to-copy>\f[R]
Copy a file to the topic folder. Copy a file to the topic folder.
.RS
.RE
.TP .TP
.B \f[C]search\ <term\-to\-search>\f[] .B \f[C]search <term-to-search>\f[R]
Search for a term in \f[C]$MEMO_DIR\f[] using \f[C]ack\f[]. Search for a term in \f[C]$MEMO_DIR\f[R] using \f[C]ack\f[R].
.RS
.RE
.TP .TP
.B \f[C]show\ <topic>\f[] .B \f[C]show <topic>\f[R]
Shows \f[C]memo.md\f[] in the topic folder. Shows \f[C]memo.md\f[R] in the topic folder.
Also shows a list of all files in the topic folder. Also shows a list of all files in the topic folder.
.RS
.RE
.TP .TP
.B \f[C]edit\ <topic>\f[] .B \f[C]edit <topic>\f[R]
Opens your favorite editor to edit the memo topic. Opens your favorite editor to edit the memo topic.
.RS
.RE
.TP .TP
.B \f[C]list\f[] .B \f[C]list\f[R]
Prints a list of all topics. Prints a list of all topics.
.RS
.RE
.TP .TP
.B \f[C]git\ <command>\f[] .B \f[C]git <command>\f[R]
Run a git command in \f[C]$MEMO_DIR\f[]. Run a git command in \f[C]$MEMO_DIR\f[R].
Once \f[C]$MEMO_DIR\f[] is a git repository, all memo commands create Once \f[C]$MEMO_DIR\f[R] is a git repository, all memo commands create
commits. commits.
.RS
.RE
.SH CONFIGURATION .SH CONFIGURATION
.TP .TP
.B \f[C]$MEMO_DIR\f[] .B \f[C]$MEMO_DIR\f[R]
holds the folder where to store the memo files. holds the folder where to store the memo files.
Default is \f[C]$HOME/memo\f[]. Default is \f[C]$HOME/memo\f[R].
.RS
.RE
.TP .TP
.B \f[C]$EDITOR\f[] .B \f[C]$EDITOR\f[R]
Your favorite editor. Your favorite editor.
Must be set for the edit command. Must be set for the edit command.
.RS
.RE
.SH EXAMPLE .SH EXAMPLE
.PP .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]. file in the topic \[lq]google\[rq].
.IP .IP
.nf .nf
\f[C] \f[C]
$\ memo\ add\ google\ A\ search\-engine $ memo add google A search-engine
\f[] \f[R]
.fi .fi
.PP .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]. file the topic \[lq]google\[rq].
.IP .IP
.nf .nf
\f[C] \f[C]
$\ curl\ www.google.com\ |\ memo\ add\ google $ curl www.google.com | memo add google
\f[] \f[R]
.fi .fi
.PP .PP
Copy the \[lq]Invoice.pdf\[rq] file to the \[lq]lawsuit\[rq] topic. Copy the \[lq]Invoice.pdf\[rq] file to the \[lq]lawsuit\[rq] topic.
.IP .IP
.nf .nf
\f[C] \f[C]
$\ memo\ copy\ lawsuit\ ~/Downloads/Invoice.pdf $ memo copy lawsuit \[ti]/Downloads/Invoice.pdf
\f[] \f[R]
.fi .fi
.PP .PP
Make \f[C]$MEMO_DIR\f[] a git repository. Make \f[C]$MEMO_DIR\f[R] a git repository.
.IP .IP
.nf .nf
\f[C] \f[C]
$\ memo\ git\ init $ memo git init
\f[] \f[R]
.fi .fi

6
memo
View File

@ -106,6 +106,12 @@ function remove_topic (){
function edit_topic () { function edit_topic () {
topic_name=$1 topic_name=$1
if [[ -z $topic_name ]]
then
echo "you have to specify a topic"
exit 1
fi
precondition:provide_topic ${topic_name} precondition:provide_topic ${topic_name}
topic_path=${MEMO_FOLDER}/${topic_name} topic_path=${MEMO_FOLDER}/${topic_name}