diff --git a/cmd/restic/cmd_key.go b/cmd/restic/cmd_key.go index 876408e85..168ed82d3 100644 --- a/cmd/restic/cmd_key.go +++ b/cmd/restic/cmd_key.go @@ -12,7 +12,7 @@ import ( ) var cmdKey = &cobra.Command{ - Use: "key [list|add|rm|passwd] [ID]", + Use: "key [list|add|remove|passwd] [ID]", Short: "manage keys (passwords)", Long: ` The "key" command manages keys (passwords) for accessing the repository. @@ -124,7 +124,7 @@ func changePassword(gopts GlobalOptions, repo *repository.Repository) error { } func runKey(gopts GlobalOptions, args []string) error { - if len(args) < 1 || (args[0] == "rm" && len(args) != 2) || (args[0] != "rm" && len(args) != 1) { + if len(args) < 1 || (args[0] == "remove" && len(args) != 2) || (args[0] != "remove" && len(args) != 1) { return errors.Fatal("wrong number of arguments") } @@ -153,7 +153,7 @@ func runKey(gopts GlobalOptions, args []string) error { } return addKey(gopts, repo) - case "rm": + case "remove": lock, err := lockRepoExclusive(repo) defer unlockRepo(lock) if err != nil { diff --git a/cmd/restic/integration_test.go b/cmd/restic/integration_test.go index ca548eaf5..449b1c93e 100644 --- a/cmd/restic/integration_test.go +++ b/cmd/restic/integration_test.go @@ -786,7 +786,7 @@ func testRunKeyPasswd(t testing.TB, newPassword string, gopts GlobalOptions) { func testRunKeyRemove(t testing.TB, gopts GlobalOptions, IDs []string) { t.Logf("remove %d keys: %q\n", len(IDs), IDs) for _, id := range IDs { - OK(t, runKey(gopts, []string{"rm", id})) + OK(t, runKey(gopts, []string{"remove", id})) } }