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:
Ricardo Seriani 2017-08-17 11:03:26 -03:00
parent d87b2f189d
commit 62ed776a8c
2 changed files with 4 additions and 4 deletions

View File

@ -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 {

View File

@ -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}))
}
}