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

feat: add config shorthand #210

Merged
merged 1 commit into from
Oct 16, 2024
Merged

feat: add config shorthand #210

merged 1 commit into from
Oct 16, 2024

Conversation

lvlcn-t
Copy link
Collaborator

@lvlcn-t lvlcn-t commented Oct 15, 2024

Motivation

To add a -c flag shorthand for the config. We should have this since it's a common flag that is always passed to the CLI and it's cumbersome to always write the whole --config flag everytime you want to run sparrow.

Changes

Added a shorthand for the --config flag.

For additional information look at the commits.

Tests done

New help description reflects the new shorthand:

❯ go run . 
Sparrow is an infrastructure monitoring agent that is able to perform different checks.
The check results are exposed via an API.

Usage:
  sparrow [command]

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  help        Help about any command
  run         Run sparrow

Flags:
  -c, --config string   config file (default is $HOME/.sparrow.yaml)
  -h, --help            help for sparrow

Use "sparrow [command] --help" for more information about a command.

❯ go run . run -c ./.tmp/config/start.yaml
Using config file: ./.tmp/config/start.yaml
{"time":"2024-10-15T23:42:07.797637971+02:00","level":"INFO","source":{"function":"github.com/caas-team/sparrow/cmd.NewCmdRun.run.func1","file":"/home/tom/dev/sparrow/cmd/run.go","line":89},"msg":"Running sparrow"}
  • Unit tests succeeded - Not applicable
  • E2E tests succeeded - Not applicable

TODO

  • I've assigned this PR to myself
  • I've labeled this PR correctly

Signed-off-by: lvlcn-t <75443136+lvlcn-t@users.noreply.github.com>
@lvlcn-t lvlcn-t added docs Improvements or additions to documentation feature Introduces a new feature area/config Issues/PRs related to the startup/sparrow config area labels Oct 15, 2024
@lvlcn-t lvlcn-t self-assigned this Oct 15, 2024
@lvlcn-t lvlcn-t merged commit 120b24c into main Oct 16, 2024
8 checks passed
@lvlcn-t lvlcn-t deleted the feat/config-shorthand branch October 16, 2024 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/config Issues/PRs related to the startup/sparrow config area docs Improvements or additions to documentation feature Introduces a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants