Skip to content

Commit

Permalink
Reorganize log messages pertaining to CLI arguments
Browse files Browse the repository at this point in the history
Make it clearer when the CLI account/reservation is being parsed. I don't want
to refactor the config class to handle CLI arguments as an account (rather,
it will be handled after) as it would require a refactor and makes it much
harder to distinguish when the config parses an account/reservation in
the config file versus the CLI.
  • Loading branch information
jdholtz committed Mar 5, 2024
1 parent e74922b commit 71d6d22
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,17 @@ def set_up_check_in(arguments: List[str]) -> None:
test_notifications(config)
sys.exit()
elif len(arguments) == 2:
logger.debug("Adding account through CLI arguments")
account = {"username": arguments[0], "password": arguments[1]}
config.create_account_config([account])
logger.debug("Account added through CLI arguments")
elif len(arguments) == 3:
logger.debug("Adding reservation through CLI arguments")
reservation = {
"confirmationNumber": arguments[0],
"firstName": arguments[1],
"lastName": arguments[2],
}
config.create_reservation_config([reservation])
logger.debug("Reservation added through CLI arguments")
elif len(arguments) > 3:
logger.error("Invalid arguments. For more information, try '--help'")
sys.exit(2)
Expand Down

0 comments on commit 71d6d22

Please sign in to comment.