mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Allow an empty field specifier in calibredb, permitting one to get a list of ids
This commit is contained in:
parent
748eb921c5
commit
d47603bdac
@ -199,6 +199,7 @@ def command_list(args, dbpath):
|
||||
afields.add('*'+f)
|
||||
if data['datatype'] == 'series':
|
||||
afields.add('*'+f+'_index')
|
||||
if opts.fields.strip():
|
||||
fields = [str(f.strip().lower()) for f in opts.fields.split(',')]
|
||||
if 'all' in fields:
|
||||
fields = sorted(list(afields))
|
||||
@ -208,6 +209,8 @@ def command_list(args, dbpath):
|
||||
prints(_('Invalid fields. Available fields:'),
|
||||
','.join(sorted(afields)), file=sys.stderr)
|
||||
return 1
|
||||
else:
|
||||
fields = []
|
||||
|
||||
if not opts.sort_by in afields and opts.sort_by is not None:
|
||||
parser.print_help()
|
||||
|
Loading…
x
Reference in New Issue
Block a user