aboutsummaryrefslogtreecommitdiffstats
path: root/commands/user_adopt.go
diff options
context:
space:
mode:
Diffstat (limited to 'commands/user_adopt.go')
-rw-r--r--commands/user_adopt.go40
1 files changed, 0 insertions, 40 deletions
diff --git a/commands/user_adopt.go b/commands/user_adopt.go
deleted file mode 100644
index afef94ea..00000000
--- a/commands/user_adopt.go
+++ /dev/null
@@ -1,40 +0,0 @@
-package commands
-
-import (
- "github.com/spf13/cobra"
-)
-
-func newUserAdoptCommand() *cobra.Command {
- env := newEnv()
-
- cmd := &cobra.Command{
- Use: "adopt USER-ID",
- Short: "Adopt an existing identity as your own.",
- Args: cobra.ExactArgs(1),
- PreRunE: loadBackend(env),
- RunE: closeBackend(env, func(cmd *cobra.Command, args []string) error {
- return runUserAdopt(env, args)
- }),
- ValidArgsFunction: completeUser(env),
- }
-
- return cmd
-}
-
-func runUserAdopt(env *Env, args []string) error {
- prefix := args[0]
-
- i, err := env.backend.ResolveIdentityPrefix(prefix)
- if err != nil {
- return err
- }
-
- err = env.backend.SetUserIdentity(i)
- if err != nil {
- return err
- }
-
- env.out.Printf("Your identity is now: %s\n", i.DisplayName())
-
- return nil
-}