-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Added new alias for 'decoration=always' #1141
Conversation
Thank you very much. The implementation looks good. My only concern is the letter for the flag. I would actually like to combine What do you think? Also, @eth-p: how do you feel about introducing a new short option for this? I tend to use |
I think it's a great idea. |
I think it would be a good idea. I've found myself wanting to pipe bat output into other programs before, and it's a bit inconvenient to have to pass both by full name. On top of that, it would also be a nice analogy to the -p flag (albeit doing the exact opposite thing). |
I think that's a good tip. And a seemingly useful alias combo. I will give it another go with both flags. |
src/bin/bat/clap_app.rs
Outdated
.arg( | ||
Arg::with_name("always-decorations") | ||
.short("f") | ||
.alias("always-decor") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see much value in this. For me, long options are useful for scripts, due to the self-documenting character. Short options are useful when I have to type it in the console. An abbreviated long option would be for what?
src/bin/bat/clap_app.rs
Outdated
Arg::with_name("always-decorations") | ||
.short("f") | ||
.alias("always-decor") | ||
.overrides_with("always-decorations") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it also "conflict with" --color=…
and --decorations=…
?
src/bin/bat/clap_app.rs
Outdated
.short("f") | ||
.alias("always-decor") | ||
.overrides_with("always-decorations") | ||
.hidden(true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hiding from short -h
text is fine, but I think this should appear in the long --help
text.
src/bin/bat/clap_app.rs
Outdated
.overrides_with("always-decorations") | ||
.hidden(true) | ||
.hidden_short_help(true) | ||
.help("Alias for '--decorations=always --color=always'") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we please use a proper sentence here like for the rest of the command line options? Maybe we could also add:
"This is useful if the output of bat is piped to another program, but you want to keep the colorization/decorations."
src/bin/bat/clap_app.rs
Outdated
@@ -257,6 +257,15 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> { | |||
an interactive terminal is detected. Possible values: *auto*, never, always.", | |||
), | |||
) | |||
.arg( | |||
Arg::with_name("always-decorations") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the extended functionality, I would rename this to --force-colorization
maybe?
Could you please also update the man page in Also, could you please add an entry to the "unreleased" section in
where |
Thank you very much for the updates! |
This PR addresses #1108 .
Hey all, first time making a PR for a rust repo and still pretty new to it.
Think I addressed the feature here for adding an alias for
--decoration=always
with the-D
arg. The-D
commands works the same as if--decoration=always
or if running on a terminal that can support decorations (e.g---decoration=auto
)Let me know. Thanks!