2017-01-08 17:24:03 +01:00
|
|
|
package obscure
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
"github.com/ncw/rclone/cmd"
|
2018-01-18 21:19:55 +01:00
|
|
|
"github.com/ncw/rclone/fs/config/obscure"
|
2017-01-08 17:24:03 +01:00
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cmd.Root.AddCommand(commandDefintion)
|
|
|
|
}
|
|
|
|
|
|
|
|
var commandDefintion = &cobra.Command{
|
|
|
|
Use: "obscure password",
|
|
|
|
Short: `Obscure password for use in the rclone.conf`,
|
|
|
|
Run: func(command *cobra.Command, args []string) {
|
|
|
|
cmd.CheckArgs(1, 1, command, args)
|
|
|
|
cmd.Run(false, false, command, func() error {
|
2018-01-18 21:19:55 +01:00
|
|
|
obscured := obscure.MustObscure(args[0])
|
|
|
|
fmt.Println(obscured)
|
2017-01-08 17:24:03 +01:00
|
|
|
return nil
|
|
|
|
})
|
|
|
|
},
|
|
|
|
}
|