/
cmd_ctl_reload.go
43 lines (36 loc) · 967 Bytes
/
cmd_ctl_reload.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright 2015 Keybase, Inc. All rights reserved. Use of
// this source code is governed by the included BSD license.
package client
import (
"github.com/keybase/cli"
"github.com/keybase/client/go/libcmdline"
"github.com/keybase/client/go/libkb"
"golang.org/x/net/context"
)
func NewCmdCtlReload(cl *libcmdline.CommandLine, g *libkb.GlobalContext) cli.Command {
return cli.Command{
Name: "reload",
Usage: "Reload config file",
Action: func(c *cli.Context) {
cl.ChooseCommand(&CmdCtlReload{libkb.NewContextified(g)}, "reload", c)
cl.SetForkCmd(libcmdline.NoFork)
cl.SetNoStandalone()
},
}
}
type CmdCtlReload struct {
libkb.Contextified
}
func (s *CmdCtlReload) ParseArgv(ctx *cli.Context) error {
return nil
}
func (s *CmdCtlReload) Run() (err error) {
cli, err := GetCtlClient(s.G())
if err != nil {
return err
}
return cli.Reload(context.TODO(), 0)
}
func (s *CmdCtlReload) GetUsage() libkb.Usage {
return libkb.Usage{}
}