Skip to content

Commit aad232d

Browse files
committed
Change to more simple
1 parent ef597ab commit aad232d

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

README.md

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -261,30 +261,17 @@ Hello Someusername
261261
If you want to change the output such as coloring and bold letters, you can do as follows(example is using [fatih/color](https://github.com/fatih/color)).
262262

263263
```go
264-
import "github.com/fatih/color"
265-
266-
cyan := color.New(color.FgCyan).SprintFunc()
267-
yellow := color.New(color.FgYellow).SprintFunc()
268-
boldRed := color.New(color.FgRed, color.Bold).SprintFunc()
269-
shell.AddCmd(&ishell.Cmd{
270-
Name: "color",
271-
Help: "color print",
272-
Func: func(c *ishell.Context) {
273-
c.Print(cyan("cyan\n"))
274-
c.Println(yellow("yellow"))
275-
c.Printf("%s\n", boldRed("bold red"))
276-
},
264+
func(c *ishell.Context) {
265+
yellow := color.New(color.FgYellow).SprintFunc()
266+
c.Println(yellow("yellow"))
277267
}
278268
```
279-
Output
269+
Execution
280270
```bash
281-
$ go run main.go
282-
Sample Interactive Shell
283271
>>> color
284272
cyan
285273
yellow
286274
bold red
287-
>>>
288275
```
289276

290277

0 commit comments

Comments
 (0)