Client import CLI
This commit is contained in:
parent
97c61d4ce5
commit
55b9f8d550
33
cli/client.go
Normal file
33
cli/client.go
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
package cli
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"gopkg.in/urfave/cli.v2"
|
||||||
|
)
|
||||||
|
|
||||||
|
var clientCmd = &cli.Command{
|
||||||
|
Name: "client",
|
||||||
|
Usage: "Make deals, store data, retrieve data",
|
||||||
|
Subcommands: []*cli.Command{
|
||||||
|
clientImportCmd,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
var clientImportCmd = &cli.Command{
|
||||||
|
Name: "import",
|
||||||
|
Usage: "import data",
|
||||||
|
Action: func(cctx *cli.Context) error {
|
||||||
|
api, err := getAPI(cctx)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
ctx := reqContext(cctx)
|
||||||
|
|
||||||
|
c, err := api.ClientImport(ctx, cctx.Args().First())
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
fmt.Println(c.String())
|
||||||
|
return nil
|
||||||
|
},
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user