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 --co alias for --config-override #1397

Merged
merged 1 commit into from
Feb 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions jrnl/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,15 @@ def parse_args(args=[]):
\t jrnl --config-override colors.body blue --config-override colors.title green
""",
)
config_overrides.add_argument(
"--co",
dest="config_override",
action="append",
type=str,
nargs=2,
default=[],
help=argparse.SUPPRESS,
)

alternate_config = parser.add_argument_group(
"Specifies alternate config to be used",
Expand Down
5 changes: 5 additions & 0 deletions tests/bdd/features/override.feature
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ Feature: Implementing Runtime Overrides for Select Configuration Keys
When we run "jrnl -1 --config-override colors.body blue"
Then the config in memory should contain "colors.body: blue"

Scenario: Override color selections with --co alias
Given we use the config "basic_encrypted.yaml"
And we use the password "test" if prompted
When we run "jrnl -1 --co colors.body blue"
Then the config in memory should contain "colors.body: blue"

Scenario: Apply multiple config overrides
Given we use the config "basic_encrypted.yaml"
Expand Down