Skip to content

Commit

Permalink
Fix flag name mismatch in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mdm-code committed Sep 25, 2023
1 parent 79b6191 commit 6f81655
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/tcols/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func prepUsageAttrs(colored bool) []any {

func parse(args []string, open openFn) ([]io.Reader, func(), error) {
fs := flag.NewFlagSet("tcols", flag.ExitOnError)
for _, fName := range []string{"s", "styles"} {
for _, fName := range []string{"s", "style"} {
fs.Func(
fName,
"list of styles and colors to apply to text",
Expand Down
6 changes: 3 additions & 3 deletions cmd/tcols/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ func TestCliParse(t *testing.T) {
args []string
err error
}{
{"pass-01", []string{"-styles", "redfg bluefg"}, nil},
{"pass-01", []string{"-style", "redfg bluefg"}, nil},
{"pass-02", []string{"-s", "strike rgb24=fg:242:121:64"}, nil},
{"pass-03", []string{"-s", "yellowbg", "--styles", "bluefg"}, nil},
{"pass-03", []string{"-s", "yellowbg", "--style", "bluefg"}, nil},
{"pass-04", []string{}, nil},
}
for _, c := range cases {
Expand Down Expand Up @@ -182,7 +182,7 @@ func TestRun(t *testing.T) {
}{
{"pass-01", []string{"-s", "greenbg yellowfg bold", "1.pyc", "2.c"}, f, nil},
{"pass-02", []string{}, f, nil},
{"fail-01", []string{"--styles", "wacky", "hello.py"}, f, termcols.ErrMap},
{"fail-01", []string{"--style", "wacky", "hello.py"}, f, termcols.ErrMap},
}
for _, c := range cases {
t.Run(c.name, func(t *testing.T) {
Expand Down

0 comments on commit 6f81655

Please sign in to comment.