Skip to content

Commit

Permalink
Document the --no-reformat command line option
Browse files Browse the repository at this point in the history
  • Loading branch information
walles committed Nov 1, 2024
1 parent ed0f939 commit 4146c17
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions moar.1
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ Retain screen contents when exiting moar
\fB\-\-no\-linenumbers\fR
Hide line numbers on startup, press left arrow key to show
.TP
\fB\-\-no\-reformat\fR
Moar will implicitly reformat some input (like JSON). This switch disables that reformatting. Even with this switch, highlighting is still done.
.TP
\fB\-\-no\-statusbar\fR
Hide the status bar, toggle with
.B =
Expand Down
4 changes: 2 additions & 2 deletions moar.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ func pagerFromArgs(

noLineNumbers := flagSet.Bool("no-linenumbers", noLineNumbersDefault(), "Hide line numbers on startup, press left arrow key to show")
noStatusBar := flagSet.Bool("no-statusbar", false, "Hide the status bar, toggle with '='")
noFormat := flagSet.Bool("no-format", false, "Never format the input (but keep highlighting)")
noReFormat := flagSet.Bool("no-reformat", false, "Never reformat the input (but keep highlighting)")
quitIfOneScreen := flagSet.Bool("quit-if-one-screen", false, "Don't page if contents fits on one screen")
noClearOnExit := flagSet.Bool("no-clear-on-exit", false, "Retain screen contents when exiting moar")
statusBarStyle := flagSetFunc(flagSet, "statusbar", m.STATUSBAR_STYLE_INVERSE,
Expand Down Expand Up @@ -461,7 +461,7 @@ func pagerFromArgs(
}

var reader *m.Reader
shouldFormat := !*noFormat
shouldFormat := !*noReFormat
if stdinIsRedirected {
// Display input pipe contents
reader = m.NewReaderFromStream("", os.Stdin, formatter, m.ReaderOptions{Lexer: *lexer, ShouldFormat: shouldFormat})
Expand Down

0 comments on commit 4146c17

Please sign in to comment.