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

Prevent --terminal-width=0 and invalid forms of --terminal-width. #559

Merged
merged 3 commits into from
May 10, 2019

Conversation

eth-p
Copy link
Collaborator

@eth-p eth-p commented May 9, 2019

My proposed solution to #535, which involves validating --terminal-width to report an error if somebody provides a width of zero.

Why this approach, and not having it disable wrapping?

User convenience is definitely something to consider, but in this instance I believe having --terminal-width=0 being analogous to --wrap=never would be more of a quirky behaviour than a quality-of-life feature.

  1. Having such a feature would dilute the meaning of --terminal-width.
  2. Using --terminal-width=0 as --wrap=never isn't very clear or intuitive.
  3. Using --terminal-width=0 as a way to disable wrapping results in a conflict when you don't want wrapping, but do want to specify a specific terminal width.
  4. It's more explicit (and less characters) to type --wrap=never.

src/clap_app.rs Outdated Show resolved Hide resolved
src/clap_app.rs Outdated Show resolved Hide resolved
@sharkdp
Copy link
Owner

sharkdp commented May 10, 2019

Thank you for your contribution and the detailed description. Fully agree with your analysis. I've added two minor inline comments.

@sharkdp sharkdp merged commit 7ef0fe0 into sharkdp:master May 10, 2019
@sharkdp
Copy link
Owner

sharkdp commented May 10, 2019

Thank you for the update!

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