Skip to content

Commit fa083e1

Browse files
committed
Added note archive function
1 parent cb3e5db commit fa083e1

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

README

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@ Installing
1111
3. Add `source ~/bin/notes/notes` to `~/.profile` **or** `~/.bash_profile`
1212

1313
Using
14-
--------
14+
-----
1515

1616
Now you should be able to use Notes, like so:
1717

1818
notes # to list all notes
1919
new-note asdf # to create a note named asdf
2020
note as<TAB> # to view the note named asdf
2121
edit-note asdf # to edit the note named asdf
22+
archive-note asdf # to move the note named asdf to $NOTES_DIR/.archive
2223

2324
The End

notes

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ edit-note() {
3030
emacs $NOTES_DIR/$1.txt
3131
}
3232

33+
archive-note() {
34+
mkdir -p $NOTES_DIR/.archive
35+
mv $NOTES_DIR/$1.txt $NOTES_DIR/.archive
36+
}
37+
3338
_find_notes() {
3439
NOTES=()
3540
for i in `(find $NOTES_DIR -name '*.txt' -not -path $NOTES_DIR'/.archive/*')`
@@ -51,3 +56,4 @@ _note_complete() {
5156

5257
complete -F _note_complete note
5358
complete -F _note_complete edit-note
59+
complete -F _note_complete archive-note

0 commit comments

Comments
 (0)