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 support for nested configuration #76

Merged
merged 3 commits into from
Nov 25, 2024
Merged

Conversation

DannyBen
Copy link
Owner

@DannyBen DannyBen commented Nov 25, 2024

cc #74

This PR adds support for nested configuration:

git:
- --help
- --version
- init:
  - --help
  - --bare
- checkout:
  - --help
  # + prefix is a wildcard (can also use "*--branches" instead, but in quotes)
  - +--branch: &branches
    - dev
    - master
  - +-b: *branches

This configuration will be internally converted to the "flat" config:

git:
- "--help"
- "--version"
- init
- checkout
git init:
- "--help"
- "--bare"
git checkout:
- "--help"
- "--branch"
- "-b"
git checkout*--branch:
- dev
- master
git checkout*-b:
- dev
- master

Notes:

  • Asterisks for flag completion need to be specified at the beginning of any flag that requires it: - "*--branch"
  • Since asterisks have special meaning in YAML, you can also use + instead: - +--branches - this way, there is no need for quotes.
  • Items that start with a wildcard (* or +) will be stitched to its prefix without a leading space.

This change should be backwards compatible - so anyone can use either the flat or nested config, or even mix and match the two in the same file.

@DannyBen DannyBen added this to the 0.7.0 milestone Nov 25, 2024
@DannyBen DannyBen merged commit bf0c143 into master Nov 25, 2024
7 checks passed
@DannyBen DannyBen deleted the add/nested-config-support branch November 25, 2024 13:06
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