github.com/xhghs/rclone@v1.51.1-0.20200430155106-e186a28cced8/cmd/reveal/reveal.go (about) 1 package reveal 2 3 import ( 4 "fmt" 5 6 "github.com/rclone/rclone/cmd" 7 "github.com/rclone/rclone/fs/config/obscure" 8 "github.com/spf13/cobra" 9 ) 10 11 func init() { 12 cmd.Root.AddCommand(commandDefinition) 13 } 14 15 var commandDefinition = &cobra.Command{ 16 Use: "reveal password", 17 Short: `Reveal obscured password from rclone.conf`, 18 Run: func(command *cobra.Command, args []string) { 19 cmd.CheckArgs(1, 1, command, args) 20 cmd.Run(false, false, command, func() error { 21 revealed, err := obscure.Reveal(args[0]) 22 if err != nil { 23 return err 24 } 25 fmt.Println(revealed) 26 return nil 27 }) 28 }, 29 Hidden: true, 30 }