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

feat: Add or document inverse flag options #124

Open
simsrw73 opened this issue Feb 22, 2023 · 7 comments
Open

feat: Add or document inverse flag options #124

simsrw73 opened this issue Feb 22, 2023 · 7 comments

Comments

@simsrw73
Copy link

On Windows, using PowerShell Get-Help with $PAGER configured to use moar, it's cutting of lines when line numbers are displayed. I don't know if that's a bug in moar or PowerShell. PowerShell doesn't give any options for configuring paging at all. Line wrapping option doesn't help at all: words are still cut off. I can add the -no-linenumbers flag to the $MOAR variable to fix it, but then I ran in to the problem of how to show line numbers in other instances. It took me a long time before I blindly stumbled on the solution: -no-linenumbers=f. That's terribly ugly and not documented anywhere that I can see.

Can we have inverted flags for boolean options? -linenumbers or -show-linenumbers? Or at the very least, document how to supply values to boolean flags? This was not obvious to me.

@walles
Copy link
Owner

walles commented Feb 22, 2023

Sounds like fixing that "it's cutting of lines when line numbers are displayed" would be good as well.

Could you please add to this ticket:

  • A screenshot of the problem
  • A moar version number

Since I don't have access to any Windows machine I may not be able to repro this, but at least having a screenshot would be good.

@walles
Copy link
Owner

walles commented Feb 22, 2023

Also, just out of curiosity, how did you install moar on Windows?

@simsrw73
Copy link
Author

simsrw73 commented Feb 22, 2023

Installed with scoop package manager (https://scoop.sh)

❯ scoop info moar

Name : moar
Description : A pager designed to work without any configuration
Version : 1.11.4
Bucket : extras
Website : https://github.com/walles/moar
License : BSD-2-Clause-Views
Updated at : 2023-01-11 11:50:52
Updated by : github-actions[bot]
Installed : 1.11.4
Binaries : moar.exe

$PAGER=moar
$MOAR='--style catppuccin-mocha --no-linenumbers'
nolineno

$PAGER=moar
$MOAR='--style catppuccin-mocha'
lineno

@simsrw73
Copy link
Author

I can repro this on Linux.

pwsh
update-help
help get-help
exit

You can setup the PAGER & MOAR vars before runing pwsh or from within

$Env:PAGER = moar
$Env:MOAR = '-no-linenumbers'

@walles
Copy link
Owner

walles commented Feb 26, 2023

Is the problem that pwsh line breaks the help text before sending it to moar, just like man?

Ref: #119 (comment)

Otherwise, can you point out in detail one thing you'd like to look different in one of your screenshots?

@walles
Copy link
Owner

walles commented Feb 26, 2023

Did you want me to break this in to multiple issues... ?

Yes :)

@simsrw73
Copy link
Author

Is the problem that pwsh line breaks the help text before sending it to moar, just like man?

Yes. I don't believe this is an issue with moar. That's why I didn't write that issue up specifically. The help built-in function of pwsh formats the help document according to the width of the terminal, not accounting for moar or any other utility adding line numbers or any extra columns. It's not even useful to have line numbers in help, it only came up because line numbers is moar's default, which would be great if pwsh gave a way to override the PAGER command specifically for help.

So, by necessity, what I need is to be able to set MOAR to default to -no-linenumbers, and then invoke moar with line numbers in cases where I need it (probably with an alias). That is the main issue I was intending to bring up here: Adding/documenting inverse flags. Eg. -show-linenumbers / -no-linenumbers / -no-linenumbers=f. I hate that last syntax's double negative, but it works as is right now. It's just not documented.

Sorry we got side-tracked.

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

No branches or pull requests

2 participants