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 cmd line parser #512

Merged
merged 1 commit into from
Jul 18, 2023

Conversation

sebastianwebber
Copy link
Contributor

This PR adds the clap library and configures the necessary args to parse from the command line, expanding the current option of a single file and adding support for environment variables.

❯ cargo run -- --help  
    Finished dev [unoptimized + debuginfo] target(s) in 0.27s
     Running `target/debug/pgcat --help`
PgCat: Nextgen PostgreSQL Pooler

Usage: pgcat [OPTIONS] [CONFIG_FILE]

Arguments:
  [CONFIG_FILE]  [env: CONFIG_FILE=] [default: pgcat.toml]

Options:
  -l, --log-level <LOG_LEVEL>  [env: LOG_LEVEL=] [default: INFO]
  -h, --help                   Print help
  -V, --version                Print version

This commit adds the clap library and configures the necessary args to
parse from the command line,  expanding the current option of a single
file and adding support for environment variables.

Signed-off-by: Sebastian Webber <sebastian@swebber.me>
@levkk
Copy link
Contributor

levkk commented Jul 18, 2023

Love it, thank you!

@levkk levkk merged commit 7bdb4e5 into postgresml:main Jul 18, 2023
@sebastianwebber sebastianwebber deleted the sebastian/add-cmd-options branch July 18, 2023 20:53
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