summarylogtreecommitdiffstats
path: root/empty_tags.patch
blob: 9c13ef72d16e8d4326037721a2fd6a0230e632c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
:100755 100755 2ee28e7 0000000 M	xapers/__main__.py

diff --git a/xapers/__main__.py b/xapers/__main__.py
index 2ee28e7..753b787 100755
--- a/xapers/__main__.py
+++ b/xapers/__main__.py
@@ -218,6 +218,7 @@ resultant entry upon completion.
         )
         parser.add_argument(
             '--tags', '-t', metavar='TAG[,TAG...]',
+            default='',
             help="initial tags for document, comma separated",
         )
         parser.add_argument(
@@ -246,7 +247,8 @@ resultant entry upon completion.
     else:
         doc = Document(db)
 
-    args.tags = args.tags.split(',')
+    if args.tags:
+        args.tags = args.tags.split(',')
 
     # load the file
     if args.file:
@@ -378,6 +380,7 @@ def cmd_import(parser, args=None):
         )
         parser.add_argument(
             '--tags', '-t', metavar='TAG[,TAG...]',
+            default='',
             help="tags to apply to created entries",
         )
         parser.add_argument(
@@ -423,7 +426,8 @@ def cmd_import(parser, args=None):
                 print(f"  Adding file: {filepath}", file=sys.stderr)
                 doc.add_file(filepath)
 
-            doc.add_tags(args.tags.split(','))
+            if args.tags:
+                doc.add_tags(args.tags.split(','))
 
             doc.sync()