Commit 89c435ad authored by Jameson Rollins's avatar Jameson Rollins
Browse files

cli: option to recursively list all elements of the budget

parent 1fec6185
...@@ -102,6 +102,9 @@ group.add_argument( ...@@ -102,6 +102,9 @@ group.add_argument(
group.add_argument( group.add_argument(
'--diff', '-d', metavar='IFO', '--diff', '-d', metavar='IFO',
help="show difference table between IFO and another IFO description (name or path) and exit (budget not calculated)") help="show difference table between IFO and another IFO description (name or path) and exit (budget not calculated)")
group.add_argument(
'--list', '-l', action='store_true',
help="list all elements of Budget (budget not calculated)")
parser.add_argument( parser.add_argument(
'--no-plot', '-np', action='store_false', dest='plot', '--no-plot', '-np', action='store_false', dest='plot',
help="suppress plotting") help="suppress plotting")
...@@ -181,6 +184,12 @@ def main(): ...@@ -181,6 +184,12 @@ def main():
ov = repr(p[2]) ov = repr(p[2])
print(fmt.format(k, v, ov)) print(fmt.format(k, v, ov))
return return
if args.list:
for i in budget.walk():
name = '.'.join([n.__class__.__name__ for n in i])
type = i[-1].__class__.__bases__[0].__name__
print(f'{name} ({type})')
return
out_data_files = set() out_data_files = set()
out_plot_files = set() out_plot_files = set()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment