Skip to content

Commit

Permalink
Merge pull request #78 from Pennycook/remove-source-option
Browse files Browse the repository at this point in the history
Remove --source-dir (-S) option
  • Loading branch information
Pennycook authored Mar 11, 2024
2 parents 1a6dce2 + 8fffc50 commit 40c9346
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 40c9346

Please sign in to comment.