Skip to content

Commit

Permalink
Simplify the --report option
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Pennycook committed Apr 3, 2024
1 parent d9bcb33 commit c295e15
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions bin/codebasin
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,11 @@ def main():
"--report",
dest="reports",
metavar="<report>",
default=["all"],
action="append",
default=[],
choices=["all", "summary", "clustering"],
nargs="+",
help="Generate a report of the specified type.",
help="Generate a report of the specified type. "
+ "May be specified multiple times.",
)
deprecated_args.add_argument(
"-d",
Expand Down Expand Up @@ -144,11 +145,11 @@ def main():
"--dump will be removed in a future release.",
DeprecationWarning,
)
if len(args.reports) > 1:
warnings.warn(
"Passing more than one value to --report (-R) is deprecated.",
DeprecationWarning,
)

# If no specific report was specified, generate all reports.
# Handled here to prevent "all" always being in the list.
if len(args.reports) == 0:
args.reports = ["all"]

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

0 comments on commit c295e15

Please sign in to comment.