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

Add clap as a CLI argument parser and add debug flag to change log level #154

Merged
merged 2 commits into from
Dec 1, 2024

Conversation

jannikac
Copy link
Contributor

Hi,
I took a look at you code and thought why not use a pre-made CLI parsing library like clap to parse the CLI arguments instead of doing it manually. This also automatically generates a help menu with --help or -h and by deriving version also prints the programs version when --version or -V` is passed.

I've also added a --debug or -d flag which enables debug logging and therefore changes the default log level to info because I think a regular user would be fine with logging just the info messages and adding more logging when they so desire.

I thought this would be useful as a base to later implement more CLI args like changing the config file location.

@haimgel haimgel self-requested a review December 1, 2024 15:35
Copy link
Owner

@haimgel haimgel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏 (pun intended), thank you!

@haimgel haimgel merged commit 433946c into haimgel:main Dec 1, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants