Exemplo n.º 1
0
func (v *CmdID) Run() error {
	var cli keybase1.IdentifyClient
	protocols := []rpc.Protocol{}

	if !v.useDelegateUI {
		protocols = append(protocols, NewIdentifyUIProtocol(v.G()))
	}
	cli, err := GetIdentifyClient(v.G())
	if err != nil {
		return err
	}
	if err := RegisterProtocolsWithContext(protocols, v.G()); err != nil {
		return err
	}

	arg := v.makeArg()
	_, err = cli.Identify(context.TODO(), arg)
	if _, ok := err.(libkb.SelfNotFoundError); ok {
		msg := `Could not find UID or username for you on this device.
You can either specify a user to id: keybase id <username>
Or log in once on this device and run "keybase id" again.
`
		v.G().UI.GetDumbOutputUI().Printf(msg)
		return nil
	}
	return err
}
Exemplo n.º 2
0
func (v *CmdID) Run() error {
	var cli keybase1.IdentifyClient
	protocols := []rpc.Protocol{
		NewIdentifyUIProtocol(),
	}
	cli, err := GetIdentifyClient()
	if err != nil {
		return err
	}
	if err := RegisterProtocols(protocols); err != nil {
		return err
	}

	arg := v.makeArg()
	_, err = cli.Identify(context.TODO(), arg.Export())
	if _, ok := err.(libkb.SelfNotFoundError); ok {
		GlobUI.Println("Could not find UID or username for you on this device.")
		GlobUI.Println("You can either specify a user to id:  keybase id <username>")
		GlobUI.Println("Or log in once on this device and run `keybase id` again.")
		return nil
	}
	return err
}