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

Use urfave/cli v2 as argparser #24

Open
Noroth opened this issue Dec 19, 2022 · 2 comments
Open

Use urfave/cli v2 as argparser #24

Noroth opened this issue Dec 19, 2022 · 2 comments
Labels
good first issue Good for newcomers

Comments

@Noroth
Copy link
Contributor

Noroth commented Dec 19, 2022

Use https://github.com/spf13/cobra as a better arg parser instead of the flag package.

Use urfave/cli v2 as arg parser similar to its use in reg-room-service/cmd/main.go.

@Jumpy-Squirrel
Copy link
Contributor

Jumpy-Squirrel commented Jan 16, 2023

Cobra might be overkill. I can sort of see us using pflag, which cobra is based on, but when we go to containers (soon?) some of the flags will go away:

  • migrate database would become a pre-deployment job container, or else we must do complicated gymnastics to prevent starting two instances of our service at the same time which both try to migrate the database, leaving it in unusable state
    (edit: this is a separate issue and not part of this issue. For now, we stick with migrate-database as is)
  • log style selection should default to json logging, with the switch to human readable a field in the config.yaml. It's not a problem if the service starts with json logging on dev machines and switches after the first line
  • the path to the config file should be fixed, possibly allowing another override via environment variable
  • (did I forget any cmd line flags?)

Edit: I like what the room-service does, it's so clear and simple, we should just stick with it.

@Noroth Noroth added the good first issue Good for newcomers label Feb 3, 2023
@Jumpy-Squirrel
Copy link
Contributor

New target solution: github.com/urfave/cli (v2) instead of cobra.

Compare https://github.com/eurofurence/reg-room-service/blob/main/cmd/reg-room-service/main.go this is extremely clear and very easy to understand, and allows setting everything via env if desired.

@Jumpy-Squirrel Jumpy-Squirrel changed the title Use Cobra library as argparser Use urfave/cli v2 as argparser Nov 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants