Skip to content

Commit

Permalink
Indent examples in line with other help sections (#112)
Browse files Browse the repository at this point in the history
* Indent examples in line with other help sections

* Redo demos
  • Loading branch information
FollowTheProcess authored Oct 25, 2024
1 parent 777dd91 commit 82da24d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ version: "3"

vars:
COV_DATA: coverage.out
PACKAGE: github.com/FollowTheProcess/cli

tasks:
default:
Expand Down
2 changes: 1 addition & 1 deletion command.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ type example struct {

// String implements [fmt.Stringer] for [Example].
func (e example) String() string {
return fmt.Sprintf("\n# %s\n$ %s\n", e.comment, e.command)
return fmt.Sprintf("\n # %s\n $ %s\n", e.comment, e.command)
}

// Execute parses the flags and arguments, and invokes the Command's Run
Expand Down
Binary file modified docs/img/quickstart.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions testdata/TestHelp/with-examples.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ A placeholder for something cool
Usage: test [OPTIONS] ARGS...

Examples:
# Do a thing
$ test do thing --now
# Do a thing
$ test do thing --now

# Do a different thing
$ test do thing --different
# Do a different thing
$ test do thing --different

Options:
-h --help bool Show help for test [default false]
Expand Down

0 comments on commit 82da24d

Please sign in to comment.