commit 7c27a9331780c2dc0ffebcffa9f05959fab126fe
parent 3cbe58b072c8c4000479cf93ca2340522e323c5a
Author: Alexey Shiklomanov <ashiklom@bu.edu>
Date: Tue, 3 Oct 2017 08:09:38 -0400
Tag API: Case insensitive matching for tag add/rm
Diffstat:
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/simplenote_cli/sncli.py b/simplenote_cli/sncli.py
@@ -1223,8 +1223,8 @@ def cli_note_tags_add(self, key, new_tags):
# Add tag only if it isn't already there
old_tags = self.cli_note_tags_get(key)
if old_tags:
- old_tag_list = old_tags.split(',')
- new_tag_list = new_tags.split(',')
+ old_tag_list = old_tags.lower().split(',')
+ new_tag_list = new_tags.lower().split(',')
tag_list = old_tag_list
for tag in new_tag_list:
if tag not in tag_list:
@@ -1244,8 +1244,8 @@ def cli_note_tags_rm(self, key, rm_tags):
old_tags = self.cli_note_tags_get(key)
if old_tags:
- old_tag_list = old_tags.split(',')
- rm_tag_list = rm_tags.split(',')
+ old_tag_list = old_tags.lower().split(',')
+ rm_tag_list = rm_tags.lower().split(',')
tag_list = old_tag_list
for tag in rm_tag_list:
if tag in tag_list: