2017-01-09 00:24:03 +08:00
|
|
|
package obscure
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
"github.com/ncw/rclone/cmd"
|
2018-01-19 04:19:55 +08:00
|
|
|
"github.com/ncw/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
|
|
|
|
})
|
|
|
|
},
|
|
|
|
}
|