Skip to content

Commit

Permalink
Change cliargs for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
adhilto committed Jan 14, 2025
1 parent 30e6988 commit 1c9b3bd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 21 deletions.
16 changes: 2 additions & 14 deletions scubagoggles/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,12 +252,6 @@ def get_setup_args(parser: argparse.ArgumentParser, user_config: UserConfig):
type = path_parser,
help = 'OAuth2 credentials file for Google APIs')

parser.add_argument('--mkdir',
'-m',
default = False,
action = 'store_true',
help = 'Create directory(ies), if needed')

parser.add_argument('--nocheck',
'-nc',
default = False,
Expand All @@ -271,19 +265,13 @@ def get_setup_args(parser: argparse.ArgumentParser, user_config: UserConfig):
help = 'Do not download OPA executable when it does '
'not exist')

parser.add_argument('--noprompt',
'-np',
default = False,
action = 'store_true',
help = 'Do not prompt for missing items')

parser.add_argument('--opa_directory',
parser.add_argument('--opapath',
'-r',
metavar = '<directory>',
type = path_parser,
help = 'Directory containing OPA executable')

parser.add_argument('--work_directory',
parser.add_argument('--outputpath',
'-d',
metavar = '<directory>',
type = path_parser,
Expand Down
13 changes: 6 additions & 7 deletions scubagoggles/user_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ def user_directory(arguments: argparse.Namespace):
config = arguments.user_config

config_changed = False
if arguments.work_directory:
if arguments.outputpath:
# The user has explicitly specified an output directory to be used.
# We only need to check whether the directory already exists and
# save to config
print(f"Updating the default output location to {arguments.work_directory}")
arguments.work_directory = arguments.work_directory.resolve()
config.output_dir = arguments.work_directory
print(f"Updating the default output location to {arguments.outputpath}")
arguments.outputpath = arguments.outputpath.resolve()
config.output_dir = arguments.outputpath
config_changed = True

# Check to ensure the directory specified in the config exists
Expand Down Expand Up @@ -110,7 +110,7 @@ def opa_directory(arguments: argparse.Namespace):
check = not arguments.nocheck
config = arguments.user_config
download = not arguments.nodownload and check
opa_dir = arguments.opa_directory
opa_dir = arguments.opapath

if opa_dir:

Expand All @@ -124,7 +124,7 @@ def opa_directory(arguments: argparse.Namespace):
if check:
validate_opa_dir(opa_dir)
else:
print(f' {opa_dir}')
log.debug(' %s', opa_dir)

config.opa_dir = opa_dir.resolve()

Expand Down Expand Up @@ -234,7 +234,6 @@ def credentials_file(arguments: argparse.Namespace):
check = not arguments.nocheck
config = arguments.user_config
credentials = arguments.credentials
prompt = not arguments.noprompt
if credentials:
# The user has explicitly specified the credentials file. We only
# need to check whether the file exists.
Expand Down

0 comments on commit 1c9b3bd

Please sign in to comment.