"all" is a good default for --list

This commit is contained in:
Martin A. Brown 2016-02-26 11:24:19 -08:00
parent 9d1f066085
commit c5e14d6ccf
1 changed files with 6 additions and 4 deletions

View File

@ -18,6 +18,12 @@ def detail(config, args):
width = Namespace()
width.status = max([len(x) for x in tldp.inventory.status_types])
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:
status_class = tldp.inventory.status_classes[arg]
for status in status_class:
@ -91,10 +97,6 @@ def run():
argv = sys.argv[1:]
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
# this function and friends is called 'detail', because
# Python reserves a special (fundamental) meaning for the word