2017-01-09 00:24:03 +08:00
|
|
|
package obscure
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
2019-07-29 01:47:38 +08:00
|
|
|
"github.com/rclone/rclone/cmd"
|
|
|
|
"github.com/rclone/rclone/fs/config/obscure"
|
2017-01-09 00:24:03 +08: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-19 04:19:55 +08:00
|
|
|
obscured := obscure.MustObscure(args[0])
|
|
|
|
fmt.Println(obscured)
|
2017-01-09 00:24:03 +08:00
|
|
|
return nil
|
|
|
|
})
|
|
|
|
},
|
|
|
|
}
|