diff options
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp index a2c5bb7..ee8dbee 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -21,6 +21,7 @@ using namespace std; #include "lib/config.h" #include "lib/note.h" #include "lib/note_list.h" +#include "lib/file.h" void get_help() { string out = "Noteless provides a simple command line interface for note" @@ -57,6 +58,13 @@ void search_notes( note_list list, string term ) { } } +void cat_note( note_list list, string name ) { + vector<string> body = list.cat_note( name ); + for( int i = 0; i < body.size(); i++ ) { + cout << body[i] << endl; + } +} + /** * Helper function to determine which editor to use. Order or priority is * config file, environmental variable, default. @@ -121,6 +129,9 @@ int main( int argc, char** argv ) { } else if( arg == "find" ) { string term = argv[i + 1]; search_notes( list, term ); + } else if( arg == "cat" ) { + string name = argv[i + 1]; + cat_note( list, name ); } else if( arg == "help" ) { get_help(); } |