mirror of
https://github.com/rclone/rclone.git
synced 2025-12-11 22:14:05 +01:00
config: add password sub command for setting obscured passwords
This commit is contained in:
committed by
Nick Craig-Wood
parent
4355f3fe97
commit
2423fa40e2
@@ -16,6 +16,7 @@ func init() {
|
||||
configCommand.AddCommand(configCreateCommand)
|
||||
configCommand.AddCommand(configUpdateCommand)
|
||||
configCommand.AddCommand(configDeleteCommand)
|
||||
configCommand.AddCommand(configPasswordCommand)
|
||||
}
|
||||
|
||||
var configCommand = &cobra.Command{
|
||||
@@ -121,3 +122,20 @@ var configDeleteCommand = &cobra.Command{
|
||||
fs.DeleteRemote(args[0])
|
||||
},
|
||||
}
|
||||
|
||||
var configPasswordCommand = &cobra.Command{
|
||||
Use: "password <name> [<key> <value>]+",
|
||||
Short: `Update password in an existing remote.`,
|
||||
Long: `
|
||||
Update an existing remote's password. The password
|
||||
should be passed in in pairs of <key> <value>.
|
||||
|
||||
For example to set password of a remote of name myremote you would do:
|
||||
|
||||
rclone config password myremote fieldname mypassword
|
||||
`,
|
||||
RunE: func(command *cobra.Command, args []string) error {
|
||||
cmd.CheckArgs(3, 256, command, args)
|
||||
return fs.PasswordRemote(args[0], args[1:])
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user