mirror of https://github.com/tLDP/python-tldp
"all" is a good default for --list
This commit is contained in:
parent
9d1f066085
commit
c5e14d6ccf
|
@ -18,6 +18,12 @@ def detail(config, args):
|
||||||
width = Namespace()
|
width = Namespace()
|
||||||
width.status = max([len(x) for x in tldp.inventory.status_types])
|
width.status = max([len(x) for x in tldp.inventory.status_types])
|
||||||
width.stem = max([len(x) for x in i.source.keys()])
|
width.stem = max([len(x) for x in i.source.keys()])
|
||||||
|
# -- if user just said "list" with no args, then give the user something
|
||||||
|
# sane, "all"; it would make sense for this to be "work", too, but
|
||||||
|
# "all" seems to be less surprising
|
||||||
|
#
|
||||||
|
if not args:
|
||||||
|
args.append('all')
|
||||||
for arg in args:
|
for arg in args:
|
||||||
status_class = tldp.inventory.status_classes[arg]
|
status_class = tldp.inventory.status_classes[arg]
|
||||||
for status in status_class:
|
for status in status_class:
|
||||||
|
@ -91,10 +97,6 @@ def run():
|
||||||
argv = sys.argv[1:]
|
argv = sys.argv[1:]
|
||||||
config, args = tldp.config.collectconfiguration(tag, argv)
|
config, args = tldp.config.collectconfiguration(tag, argv)
|
||||||
|
|
||||||
# -- first, and foremost, set requested logging level
|
|
||||||
#
|
|
||||||
#logger.setLevel(config.loglevel)
|
|
||||||
|
|
||||||
# -- check to see if the user wishes to --list things
|
# -- check to see if the user wishes to --list things
|
||||||
# this function and friends is called 'detail', because
|
# this function and friends is called 'detail', because
|
||||||
# Python reserves a special (fundamental) meaning for the word
|
# Python reserves a special (fundamental) meaning for the word
|
||||||
|
|
Loading…
Reference in New Issue