-
Notifications
You must be signed in to change notification settings - Fork 1
/
cmd_reset.go
53 lines (42 loc) · 1.03 KB
/
cmd_reset.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
44
45
46
47
48
49
50
51
52
53
// 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"
)
type CmdReset struct{}
const (
resetPrompt = "Really delete all local cached state?"
)
func (v *CmdReset) Run() (err error) {
if err = GlobUI.PromptForConfirmation(resetPrompt); err != nil {
return
}
cli, err := GetLoginClient(G)
if err != nil {
return err
}
if err = RegisterProtocols(nil); err != nil {
return err
}
return cli.Reset(context.TODO(), 0)
}
func NewCmdReset(cl *libcmdline.CommandLine) cli.Command {
return cli.Command{
Name: "reset",
Usage: "Delete all local cached state",
Action: func(c *cli.Context) {
cl.ChooseCommand(&CmdReset{}, "reset", c)
},
}
}
func (v *CmdReset) GetUsage() libkb.Usage {
return libkb.Usage{
Config: true,
API: true,
}
}
func (v *CmdReset) ParseArgv(*cli.Context) error { return nil }