You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If for some reason you have a command that has options, but all the options are hidden, then the command that appears after it in the manpage will be indented beyond where it should be.
As an example, given
package main
import"os"import"github.com/jessevdk/go-flags"typeoptionsstruct {
Astruct {
Hiddenbool`long:"hidden" hidden:"yes"`
} `command:"a" description:"the a command as one hidden option"`Zstruct{} `command:"z" description:"the z command gets indented wrong :-("`
}
funcmain() { flags.NewParser(&options{}, 0).WriteManPage(os.Stdout) }
as /tmp/bug.go, then running go run /tmp/bug.go | MANWIDTH=60 man -l - gives you
bug(1) General Commands Manual bug(1)
NAME
bug -
SYNOPSIS
bug [OPTIONS]
DESCRIPTION
OPTIONS
COMMANDS
a
the a command as one hidden option
Usage: bug a [a-OPTIONS]
z the z command gets indented wrong :-(
22 September 2018 bug(1)
The text was updated successfully, but these errors were encountered:
chipaca
added a commit
to chipaca/go-flags
that referenced
this issue
Sep 22, 2018
It changes the definition of `(*Option).canCli()` to also check
whether an option is hidden.
There's still some work to be done in this area as a group with no
non-hidden options will also not render right, but I'll get to that
later.
If for some reason you have a command that has options, but all the options are hidden, then the command that appears after it in the manpage will be indented beyond where it should be.
As an example, given
as
/tmp/bug.go
, then runninggo run /tmp/bug.go | MANWIDTH=60 man -l -
gives youThe text was updated successfully, but these errors were encountered: