Skip to content
This repository has been archived by the owner on Aug 23, 2023. It is now read-only.

Commit

Permalink
Add website for pulsarctl (#77)
Browse files Browse the repository at this point in the history
* Add website for pulsarctl

Signed-off-by: xiaolong.ran <[email protected]>
  • Loading branch information
wolfstudy authored and maxsxu committed Mar 14, 2023
1 parent 4d8d17b commit 96f78fc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
8 changes: 4 additions & 4 deletions pkg/pulsar/descriptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@

package pulsar

import "strings"
import (
"strings"
)

var SPACES = " "
var USEDFOR = "USED FOR:"
Expand Down Expand Up @@ -47,13 +49,11 @@ func (desc *LongDescription) ToString() string {
SPACES + desc.CommandUsedFor + "\n\n" +
PERMISSION + "\n" +
SPACES + desc.CommandPermission + "\n\n" +
EXAMPLES + "\n" +
desc.exampleToString() +
OUTPUT + "\n" +
desc.outputToString()
}

func (desc *LongDescription) exampleToString() string {
func (desc *LongDescription) ExampleToString() string {
var result string
for _, v := range desc.CommandExamples {
result += SPACES + "#" + v.Desc + "\n" + SPACES + v.Command + "\n\n"
Expand Down
5 changes: 1 addition & 4 deletions pkg/pulsar/descriptions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func TestLongDescription_exampleToString(t *testing.T) {
Command: "command",
}
desc.CommandExamples = []Example{example}
res := desc.exampleToString()
res := desc.ExampleToString()

expect := " #command description\n" +
" command\n\n"
Expand All @@ -56,9 +56,6 @@ func TestLongDescription_ToString(t *testing.T) {
" " + desc.CommandUsedFor + "\n\n" +
"REQUIRED PERMISSION:\n" +
" " + desc.CommandPermission + "\n\n" +
"EXAMPLES:\n" +
" " + "#" + example.Desc + "\n" +
" " + example.Command + "\n\n" +
"OUTPUT:\n" +
" " + "#" + out.Desc + "\n" +
" " + "Out line 1" + "\n" +
Expand Down

0 comments on commit 96f78fc

Please sign in to comment.