Skip to content

Commit b46abb6

Browse files
committed
use longhelp for help
1 parent 4174e3a commit b46abb6

8 files changed

+9
-8
lines changed

cli/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ func main() {
128128
// register shell commands
129129
for _, cmd := range RegisteredCmds {
130130
handler := cmd.Handler()
131-
completer := cmd.Completer()
131+
//completer := cmd.Completer()
132132
longhelp := cmd.LongHelp()
133133
shell.AddCmd(&ishell.Cmd{
134134
Name: cmd.Name(),

kvcmds/cmd_backup.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func (c BackupCmd) Handler() func(ctx context.Context) {
5656
utils.OutputWithElapse(func() error {
5757
ic := utils.ExtractIshellContext(ctx)
5858
if len(ic.Args) < 2 {
59-
utils.Print(c.Help())
59+
utils.Print(c.LongHelp())
6060
return nil
6161
}
6262
prefix, err := utils.GetStringLit(ic.Args[0])

kvcmds/cmd_del.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func (c DeleteCmd) Handler() func(ctx context.Context) {
3434
utils.OutputWithElapse(func() error {
3535
ic := utils.ExtractIshellContext(ctx)
3636
if len(ic.Args) < 1 {
37-
utils.Print(c.Help())
37+
utils.Print(c.LongHelp())
3838
return nil
3939
}
4040
k, err := utils.GetStringLit(ic.RawArgs[1])

kvcmds/cmd_delete_prefix.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func (c DeletePrefixCmd) Handler() func(ctx context.Context) {
3939
utils.OutputWithElapse(func() error {
4040
ic := utils.ExtractIshellContext(ctx)
4141
if len(ic.Args) < 1 {
42-
utils.Print(c.Help())
42+
utils.Print(c.LongHelp())
4343
return nil
4444
}
4545
k, err := utils.GetStringLit(ic.RawArgs[1])

kvcmds/cmd_get.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func (c GetCmd) Handler() func(ctx context.Context) {
2828
utils.OutputWithElapse(func() error {
2929
ic := utils.ExtractIshellContext(ctx)
3030
if len(ic.Args) < 1 {
31-
utils.Print(c.Help())
31+
utils.Print(c.LongHelp())
3232
return nil
3333
}
3434
s := ic.RawArgs[1]

kvcmds/cmd_put.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func (c PutCmd) Handler() func(ctx context.Context) {
2929
utils.OutputWithElapse(func() error {
3030
ic := utils.ExtractIshellContext(ctx)
3131
if len(ic.Args) < 2 {
32-
fmt.Println(c.Help())
32+
fmt.Println(c.LongHelp())
3333
return nil
3434
}
3535
k, err := utils.GetStringLit(ic.RawArgs[1])

kvcmds/cmd_var.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ func (c VarCmd) Handler() func(ctx context.Context) {
3737
utils.OutputWithElapse(func() error {
3838
ic := utils.ExtractIshellContext(ctx)
3939
if len(ic.Args) < 1 {
40-
utils.Print(c.Help())
40+
utils.Print(c.LongHelp())
4141
return errors.New("wrong args")
4242
}
4343
stmt := strings.Join(ic.RawArgs[1:], " ")
4444
parts := strings.Split(stmt, "=")
4545
if len(parts) != 2 {
46-
utils.Print(c.Help())
46+
utils.Print(c.LongHelp())
4747
return errors.New("wrong format")
4848
}
4949
varName, varValue := parts[0], parts[1]

sample.csv

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
Key,Value
22
h'68656c6c6f776f726c64', nice
33
h'68656c6c6f776f726c63', helllllll
4+
Hello,World
45
1,79
56
2,54
67
3,74

0 commit comments

Comments
 (0)