-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
cmd_compat.go
47 lines (40 loc) · 1.21 KB
/
cmd_compat.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
// 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"
)
// compatibility with node client commands:
func NewCmdCompatDir(cl *libcmdline.CommandLine, g *libkb.GlobalContext) cli.Command {
desc := "`keybase dir` has been deprecated."
return cli.Command{
Name: "dir",
Action: func(c *cli.Context) {
cl.ChooseCommand(&cmdCompat{Contextified: libkb.NewContextified(g), msg: desc}, "compat", c)
},
Description: desc,
}
}
func NewCmdCompatPush(cl *libcmdline.CommandLine, g *libkb.GlobalContext) cli.Command {
desc := "Use `keybase pgp select` instead."
return cli.Command{
Name: "push",
Action: func(c *cli.Context) {
cl.ChooseCommand(&cmdCompat{Contextified: libkb.NewContextified(g), msg: desc}, "compat", c)
},
}
}
type cmdCompat struct {
libkb.Contextified
msg string
}
func (c *cmdCompat) GetUsage() libkb.Usage { return libkb.Usage{} }
func (c *cmdCompat) Run() error {
c.G().UI.GetTerminalUI().Printf("%s\n", c.msg)
return nil
}
func (c *cmdCompat) ParseArgv(ctx *cli.Context) error {
return nil
}