forked from TrueCloudLab/restic
Change key rm command to key remove
Change key rm command to key remove, to follow manual and other commands
This commit is contained in:
parent
d87b2f189d
commit
62ed776a8c
2 changed files with 4 additions and 4 deletions
cmd/restic
|
@ -12,7 +12,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var cmdKey = &cobra.Command{
|
var cmdKey = &cobra.Command{
|
||||||
Use: "key [list|add|rm|passwd] [ID]",
|
Use: "key [list|add|remove|passwd] [ID]",
|
||||||
Short: "manage keys (passwords)",
|
Short: "manage keys (passwords)",
|
||||||
Long: `
|
Long: `
|
||||||
The "key" command manages keys (passwords) for accessing the repository.
|
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 {
|
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")
|
return errors.Fatal("wrong number of arguments")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -153,7 +153,7 @@ func runKey(gopts GlobalOptions, args []string) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
return addKey(gopts, repo)
|
return addKey(gopts, repo)
|
||||||
case "rm":
|
case "remove":
|
||||||
lock, err := lockRepoExclusive(repo)
|
lock, err := lockRepoExclusive(repo)
|
||||||
defer unlockRepo(lock)
|
defer unlockRepo(lock)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -786,7 +786,7 @@ func testRunKeyPasswd(t testing.TB, newPassword string, gopts GlobalOptions) {
|
||||||
func testRunKeyRemove(t testing.TB, gopts GlobalOptions, IDs []string) {
|
func testRunKeyRemove(t testing.TB, gopts GlobalOptions, IDs []string) {
|
||||||
t.Logf("remove %d keys: %q\n", len(IDs), IDs)
|
t.Logf("remove %d keys: %q\n", len(IDs), IDs)
|
||||||
for _, id := range IDs {
|
for _, id := range IDs {
|
||||||
OK(t, runKey(gopts, []string{"rm", id}))
|
OK(t, runKey(gopts, []string{"remove", id}))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue