Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove --source-dir (-S) option #78

Merged
merged 1 commit into from
Mar 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading