Skip to content

Commit

Permalink
Remove --source-dir (-S) option
Browse files Browse the repository at this point in the history
We are contemplating adding support for per-platform source directories in a
future release. Adding such functionality would make the -S flag harder to
understand, as some users may expect to be able to specify -S multiple times.

To avoid being stuck supporting -S after 1.2.0, remove it for now.

Signed-off-by: John Pennycook <john.pennycook@intel.com>
  • Loading branch information
Pennycook committed Mar 7, 2024
1 parent 1a6dce2 commit 8fffc50
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions bin/codebasin
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,6 @@ def main():
default=None,
help="Set working root directory (default .)",
)
parser.add_argument(
"-S",
"--source-dir",
metavar="<path>",
dest="source_dir",
default=None,
help="Set path to source directory. "
+ "The default is the current directory.",
)
deprecated_args.add_argument(
"-c",
"--config",
Expand Down Expand Up @@ -167,19 +158,13 @@ def main():
DeprecationWarning,
)

# Determine the root directory based on the -S and -r flags.
# Determine the root directory based on the -r flag.
rootpath = None
if args.source_dir and args.rootdir:
raise RuntimeError(
"Cannot specify both --source-dir (-S) and --rootdir (-r).",
)
if not args.source_dir and not args.rootdir:
if not args.rootdir:
rootpath = os.getcwd()
elif args.source_dir:
rootpath = args.source_dir
elif args.rootdir:
warnings.warn(
"--rootdir (-r) is deprecated. Use --source-dir (-S) instead.",
"--rootdir (-r) is deprecated.",
DeprecationWarning,
)
rootpath = args.rootdir
Expand Down

0 comments on commit 8fffc50

Please sign in to comment.