Skip to content

feat(cli): add --print-default-config and -c/--config with presets and tilde expansion - #46

Open
felipecm-br wants to merge 1 commit into
Blankeos:mainfrom
felipecm-br:feat/cli-config-polish
Open

felipecm-br wants to merge 1 commit into
Blankeos:mainfrom
felipecm-br:feat/cli-config-polish

Conversation

@felipecm-br

Copy link
Copy Markdown
Contributor

Summary

Adds ergonomic CLI configuration flags and improves configuration file discovery:

  • --print-default-config: Prints the full default configuration YAML to stdout and exits (lazygit parity for users bootstrapping their configuration).
  • -c / --config <path>: Enables loading a custom configuration file or preset (e.g. lazygitrs -c popup or lazygitrs -c ~/custom.yml).
  • Tilde (~) Expansion: Expands leading ~ and ~/... using dirs::home_dir().
  • .yaml and .yml Support: Discovers both config.yaml and config.yml across candidate config paths and presets.
  • Informative Error Reporting: Produces a clear bail message if a specified configuration override or preset does not exist.
  • Unit Tests: Full test suite covering CLI flags, tilde expansion, and config loading failure paths.

Verification

  • cargo fmt verified.
  • cargo test --bin lazygitrs (375 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.

1 participant