-
-
Notifications
You must be signed in to change notification settings - Fork 681
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
fix(options): handling and overwriting cli opts #859
Conversation
* previously it was only possible to turn off certain features with a command line option, now it is possible to also overwrite this behavior in a sane way, for that some breaking changes happened: following options got renamed and inverted: ``` disable_mouse_mode -> mouse_mode no_pane_frames -> pane_frames ``` following cli options got added: ``` mouse-mode [bool] pane-frames [bool] simplified-ui [bool] ``` the following cli flag got removed: ``` simplified-ui ``` They can be specified in the following way: ``` zellij options --mouse-mode true ``` in order to enable the mouse mode, even if it is turned off in the config file: ``` mouse_mode: false ``` The order is now as follows: 1. corresponding flag (`disable-mouse-mode`) 2. corresponding option (`mouse-mode`) 3. corresponding config option (`mouse_mode`)
The last part is a bit confusing me. I think what you are saying, is:
Correct? Even when the flags are reversed in order? Flags should always have precedence over configuration files, so that's good! In case of multiple flags controlling the same behavior (or repeated flags), the expected behavior is less predictable, but usually "last flag wins". Is such a thing doable without a large refactor? Alternatively, an error is also acceptable... (Conflicting flags) As a side note, is it possible to make By this, i mean that Respectively, you can also use: |
Oh, and to be clear: I have zero experience in rust; every time I look at rust code, my head starts spinning 😁 Just saying, I'm basing my reply on your text, not your code. If you want a once-over of your code, someone else should really do it... |
@jovandeginste
Yes, that is correct.
Yes, that is possible, Similar goes for the implicit action.
I think that is reasonable, thanks! |
* example: ``` zellij options --mouse-mode true --disable-mouse-mode` ``` ``` $ error: The argument '--mouse-mode <mouse-mode>' cannot be used with '--disable-mouse-mode' ```
8e9b17b
to
37a4e9e
Compare
Good luck 🤞 |
previously it was only possible to turn off certain features with a
command line option, now it is possible to also overwrite this
behavior in a sane way, for that some breaking changes happened:
following options got renamed and inverted:
following cli options got added:
the following cli flag got removed:
They can be specified in the following way:
in order to enable the mouse mode, even if it is turned off in the
config file:
The order is now as follows:
disable-mouse-mode
)mouse-mode
)mouse_mode
)