diff --git a/cmd/notary/cert.go b/cmd/notary/cert.go index d82445fb09..b73dd34d27 100644 --- a/cmd/notary/cert.go +++ b/cmd/notary/cert.go @@ -45,7 +45,8 @@ var cmdCertRemove = &cobra.Command{ // certRemove deletes a certificate given a cert ID or a gun func certRemove(cmd *cobra.Command, args []string) { // If the user hasn't provided -g with a gun, or a cert ID, show usage - if len(args) < 1 && certRemoveGUN == "" { + // If the user provided -g and a cert ID, also show usage + if (len(args) < 1 && certRemoveGUN == "") || (len(args) > 0 && certRemoveGUN != "") { cmd.Usage() fatalf("must specify the cert ID or the GUN of the certificates to remove") } @@ -82,14 +83,14 @@ func certRemove(cmd *cobra.Command, args []string) { } // List all the keys about to be removed - fmt.Println("Are you sure you want to remove the following certificates?") + fmt.Printf("The following certificates will be removed:\n\n") for _, cert := range certsToRemove { // This error can't occur because we're getting certs off of an // x509 store that indexes by ID. certID, _ := trustmanager.FingerprintCert(cert) fmt.Printf("%s - %s\n", cert.Subject.CommonName, certID) } - fmt.Println("(yes/no)") + fmt.Println("\nAre you sure you want to remove these certificates? (yes/no)") // Ask for confirmation before removing certificates confirmed := askConfirm() diff --git a/cmd/notary/tuf.go b/cmd/notary/tuf.go index cc37fe77bb..3cc96428db 100644 --- a/cmd/notary/tuf.go +++ b/cmd/notary/tuf.go @@ -122,7 +122,7 @@ func tufInit(cmd *cobra.Command, args []string) { rootKeyID = keyID } - fmt.Printf("Root key found, using: %s", rootKeyID) + fmt.Printf("Root key found, using: %s\n", rootKeyID) } rootCryptoService, err := nRepo.KeyStoreManager.GetRootCryptoService(rootKeyID)