Skip to content

Commit 0c6037b

Browse files
authored
Merge pull request #95 from Pennycook/simplify-report-option
Simplify the --report option
2 parents d9bcb33 + 86b57a5 commit 0c6037b

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

bin/codebasin

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,12 @@ def main():
8686
"--report",
8787
dest="reports",
8888
metavar="<report>",
89-
default=["all"],
89+
action="append",
90+
default=[],
9091
choices=["all", "summary", "clustering"],
91-
nargs="+",
92-
help="Generate a report of the specified type.",
92+
help="Generate a report of the specified type. "
93+
+ "May be specified multiple times. "
94+
+ "If not specified, all reports will be generated.",
9395
)
9496
deprecated_args.add_argument(
9597
"-d",
@@ -144,11 +146,11 @@ def main():
144146
"--dump will be removed in a future release.",
145147
DeprecationWarning,
146148
)
147-
if len(args.reports) > 1:
148-
warnings.warn(
149-
"Passing more than one value to --report (-R) is deprecated.",
150-
DeprecationWarning,
151-
)
149+
150+
# If no specific report was specified, generate all reports.
151+
# Handled here to prevent "all" always being in the list.
152+
if len(args.reports) == 0:
153+
args.reports = ["all"]
152154

153155
# Determine the root directory based on where codebasin is run.
154156
rootdir = os.path.realpath(os.getcwd())

0 commit comments

Comments
 (0)