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(feature): toggle boolean options with cli flag #855

Merged
merged 1 commit into from
Nov 10, 2021

Conversation

a-kenji
Copy link
Contributor

@a-kenji a-kenji commented Nov 10, 2021

add the ability to toggle boolean options with a cli flag:

example:
if the pane frames are turned off in the config file,
then passing in the --no-pane-frames flag will toggle the
pane frames on

add the ability to toggle boolean options with a cli flag:

example:
    if the pane frames are turned off in the config file,
    then passing in the `--no-pane-frames` flag will toggle the
    pane frames on
@a-kenji a-kenji merged commit abbe3b2 into zellij-org:main Nov 10, 2021
@jovandeginste
Copy link

Am I reading this right that the flag's behavior depends on the current configuration value? If so, would it not make more sense to have two flags, that each override whatever is in the configuration? Ie. --pane-frames and --no-pane-frames, or perhaps --pane-frames=[true|false|1|0] (depends on what is easiest to implement)

@a-kenji
Copy link
Contributor Author

a-kenji commented Nov 10, 2021

@jovandeginste
Thank you for the input!
Yes, you are reading it right.

The --pane-frames true|false would have been the easiest to implement,
I wasn't sure if that was a good UX. Since I like having it as a flag, but also as a specific option. But maybe it would be better to make it more explicit.
What do you think?

@a-kenji
Copy link
Contributor Author

a-kenji commented Nov 10, 2021

@jovandeginste
On second thought, maybe it makes sense to rename the config option itself to:

pane_frames: true|false

that way it makes more sense having a cli option that has:

--pane-frames true|false

or mutual exclusive

--no-pane-frames

What do you think?

@jovandeginste
Copy link

Most Linux tools use the --flag, --no-flag combo, which is a good one. Alternatives are fine too. However, i would never expect --no-flag to invert whatever is in the config file... It would disabled the feature "flag", irrespective of the configuration entry for "flag". I hope my explanation is not confusing... 😁

@a-kenji
Copy link
Contributor Author

a-kenji commented Nov 10, 2021

@jovandeginste
I think that makes sense.
Do you mind going over this behavior for a quick sanity check #859 ?

@a-kenji a-kenji deleted the merge-bool-options branch May 10, 2022 06:29
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