adds chronological listing using bibtex year field
This commit is contained in:
parent
eaeb48bd20
commit
e1f56fb212
@ -22,6 +22,9 @@ def parser(subparsers, conf):
|
|||||||
parser.add_argument('-a', '--alphabetical', action='store_true',
|
parser.add_argument('-a', '--alphabetical', action='store_true',
|
||||||
dest='alphabetical', default=False,
|
dest='alphabetical', default=False,
|
||||||
help='lexicographic order on the citekeys.')
|
help='lexicographic order on the citekeys.')
|
||||||
|
parser.add_argument('-C', '--chronological', action='store_true',
|
||||||
|
dest='chronological', default=False,
|
||||||
|
help='chronological order on the year field.')
|
||||||
parser.add_argument('--no-docs', action='store_true',
|
parser.add_argument('--no-docs', action='store_true',
|
||||||
dest='nodocs', default=False,
|
dest='nodocs', default=False,
|
||||||
help='list only pubs without attached documents.')
|
help='list only pubs without attached documents.')
|
||||||
@ -45,6 +48,8 @@ def command(conf, args):
|
|||||||
papers = [p for p in papers if p.docpath is None]
|
papers = [p for p in papers if p.docpath is None]
|
||||||
if args.alphabetical:
|
if args.alphabetical:
|
||||||
papers = sorted(papers, key=lambda p: p.citekey)
|
papers = sorted(papers, key=lambda p: p.citekey)
|
||||||
|
if args.chronological:
|
||||||
|
papers = sorted(papers, key=lambda p: p.bibdata['year'])
|
||||||
else:
|
else:
|
||||||
papers = sorted(papers, key=date_added)
|
papers = sorted(papers, key=date_added)
|
||||||
if len(papers) > 0:
|
if len(papers) > 0:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user