Skip to content

Commit c295e15

Browse files
committed
Simplify the --report option
This commit brings --report in line with --platform, such that: - Each instance of --report accepts only a single argument. - --report can be specified multiple times. This is a breaking change, but --report accepting multiple values was deprecated in 1.2.0. Signed-off-by: John Pennycook <john.pennycook@intel.com>
1 parent d9bcb33 commit c295e15

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

bin/codebasin

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,11 @@ 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.",
9394
)
9495
deprecated_args.add_argument(
9596
"-d",
@@ -144,11 +145,11 @@ def main():
144145
"--dump will be removed in a future release.",
145146
DeprecationWarning,
146147
)
147-
if len(args.reports) > 1:
148-
warnings.warn(
149-
"Passing more than one value to --report (-R) is deprecated.",
150-
DeprecationWarning,
151-
)
148+
149+
# If no specific report was specified, generate all reports.
150+
# Handled here to prevent "all" always being in the list.
151+
if len(args.reports) == 0:
152+
args.reports = ["all"]
152153

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

0 commit comments

Comments
 (0)