Permalink
Browse files

Add obscure command for generating encrypted passwords for rclone's c…

…onfig
  • Loading branch information...
1 parent e426cb1 commit d4c923a5ccadb4f189ce2f501afbfc0ca0bf263e @tcf909 tcf909 committed with Jan 8, 2017
Showing with 27 additions and 0 deletions.
  1. +1 −0 cmd/all/all.go
  2. +26 −0 cmd/obscure/obscure.go
View
@@ -25,6 +25,7 @@ import (
_ "github.com/ncw/rclone/cmd/mount"
_ "github.com/ncw/rclone/cmd/move"
_ "github.com/ncw/rclone/cmd/moveto"
+ _ "github.com/ncw/rclone/cmd/obscure"
_ "github.com/ncw/rclone/cmd/purge"
_ "github.com/ncw/rclone/cmd/rmdir"
_ "github.com/ncw/rclone/cmd/rmdirs"
@@ -0,0 +1,26 @@
+package obscure
+
+import (
+ "fmt"
+
+ "github.com/ncw/rclone/cmd"
+ "github.com/ncw/rclone/fs"
+ "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 {
+ obscure := fs.MustObscure(args[0])
+ fmt.Println(obscure)
+ return nil
+ })
+ },
+}

0 comments on commit d4c923a

Please sign in to comment.