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 needy flags: flag.needs #543

Merged
merged 11 commits into from
Aug 2, 2024
Merged

Add support for needy flags: flag.needs #543

merged 11 commits into from
Aug 2, 2024

Conversation

DannyBen
Copy link
Owner

@DannyBen DannyBen commented Aug 1, 2024

Adds support for cross-dependency between flags for cases when some flags are required only if other flags were provided.

Discovered in #542

Todo

  • Initial pilot
  • Confirmed implementation
  • Example
  • Tests
  • Update bashly YAML/JSON schema
  • Update strings JSON schema
  • Update bashly docs command
  • Apply to usage help
  • Apply to mandoc / markdown generator
  • Specs pass
  • Update doc site

Sample bashly.yml

name: cli

flags:
- long: --add
  short: -a
  arg: alias
  help: Alias to add
  needs: [--command]
- long: --command
  short: -c
  arg: command
  help: Command to add
  needs: [--alias]

@DannyBen DannyBen merged commit 6469ee1 into master Aug 2, 2024
7 of 8 checks passed
@DannyBen DannyBen deleted the add/flag-needs branch August 2, 2024 03:10
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