nncli

NextCloud Notes Command Line Interface
git clone git://git.danielmoch.com/nncli.git
Log | Files | Refs | LICENSE

commit 3d90bf24eba96d2e326c9fe5027ab20f8704b4cc
parent c233663028e4a593aaad283ba91e95d16a649ad8
Author: Alexey Shiklomanov <ashiklom@bu.edu>
Date:   Sun,  1 Oct 2017 13:03:59 -0400

CLI: get note tags given key

Diffstat:
Msimplenote_cli/sncli.py | 23+++++++++++++++++++++++
1 file changed, 23 insertions(+), 0 deletions(-)

diff --git a/simplenote_cli/sncli.py b/simplenote_cli/sncli.py @@ -1193,6 +1193,17 @@ def cli_note_markdown(self, key, markdown): self.ndb.set_note_markdown(key, markdown) self.sync_notes() + def cli_note_tags_get(self, key): + + note = self.ndb.get_note(key) + if not note: + self.log('ERROR: Key does not exist') + return + + tags = utils.get_note_tags(note) + if tags: + print(tags) + def SIGINT_handler(signum, frame): print('\nSignal caught, bye!') @@ -1353,6 +1364,18 @@ def sncli_start(sync=sync, verbose=verbose, config=config): sn = sncli_start() sn.cli_note_markdown(key, 1 if args[0] == 'markdown' else 0) + # Tag API + elif args[0] == 'tag': + + if args[1] == 'get': + + if not key: + usage() + + sn = sncli_start() + sn.cli_note_tags_get(key) + + else: usage()