From ec330571e850d8358849837d1f274762612ebfee Mon Sep 17 00:00:00 2001
From: Fabien Benureau <fabien.benureau+git@gmail.com>
Date: Wed, 15 Apr 2015 16:51:15 +0200
Subject: [PATCH] option for listing all references without pdfs

---
 pubs/commands/list_cmd.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/pubs/commands/list_cmd.py b/pubs/commands/list_cmd.py
index 1874a3e..d942633 100644
--- a/pubs/commands/list_cmd.py
+++ b/pubs/commands/list_cmd.py
@@ -23,6 +23,10 @@ def parser(subparsers):
     parser.add_argument('-a', '--alphabetical', action='store_true',
             dest='alphabetical', default=False,
             help='lexicographic order on the citekeys.')
+    parser.add_argument('--no-docs', action='store_true',
+            dest='nodocs', default=False,
+            help='list only pubs without attached documents.')
+
     parser.add_argument('query', nargs='*',
             help='Paper query (e.g. "year: 2000" or "tags: math")')
     return parser
@@ -38,6 +42,8 @@ def command(args):
     papers = filter(lambda p: filter_paper(p, args.query,
                                            case_sensitive=args.case_sensitive),
                     rp.all_papers())
+    if args.nodocs:
+        papers = [p for p in papers if p.docpath is None]
     if args.alphabetical:
         papers = sorted(papers, key=lambda p: p.citekey)
     else: