Skip to content

Conversation

@DannyBen
Copy link
Member

@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
6 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.

2 participants