@@ -11,6 +11,7 @@ import (
1111 "fmt"
1212 "os"
1313 "sort"
14+ "strconv"
1415 "strings"
1516
1617 "github.com/essentialkaos/ek/v13/fmtc"
@@ -34,7 +35,7 @@ import (
3435// Basic utility info
3536const (
3637 APP = "rds-cli-completion-generator"
37- VER = "0.0.1 "
38+ VER = "0.0.2 "
3839 DESC = "Tool to generate completion for RDS CLI"
3940)
4041
@@ -220,10 +221,10 @@ func printCommandsCode(commands InfoSlice) {
220221 fmtc .NewLine ()
221222 for _ , c := range commands {
222223 if len (c .Arguments ) == 0 {
223- fmtc .Printfn (` { {y}"%s"{!}, nil },` , c .Name )
224+ fmtc .Printfn (` { {y}"%s"{!}, {*} nil{!}, {*}false{!} },` , c .Name )
224225 } else {
225226 fmtc .Printfn (
226- " { {y}\" %s\" {!}, {*}[]string{!}{" + formatArgumentsSlice (c .Arguments )+ "} }," ,
227+ " { {y}\" %s\" {!}, {*}[]string{!}{" + formatArgumentsSlice (c .Arguments )+ "}, {*}false{!} }," ,
227228 c .Name ,
228229 )
229230 }
@@ -236,7 +237,7 @@ func formatArgumentsSlice(args []string) string {
236237 var result []string
237238
238239 for _ , a := range args {
239- result = append (result , fmt .Sprintf ("{y}\" %s \" {!}" , a ))
240+ result = append (result , fmt .Sprintf ("{y}%s {!}" , strconv . Quote ( a ) ))
240241 }
241242
242243 return strings .Join (result , ", " )
0 commit comments