From f39c5e636b7f9f0af12d3f9ed2edfaa7d41ff550 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Nogueira?= Date: Tue, 26 Nov 2024 13:10:13 +0000 Subject: [PATCH] rename replace-cmt to replace-comment --- bin/main.ml | 2 +- ...e_cmt_command.t => replace_comment_command.t} | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) rename tests/{replace_cmt_command.t => replace_comment_command.t} (79%) diff --git a/bin/main.ml b/bin/main.ml index 526d7ee..9796950 100644 --- a/bin/main.ml +++ b/bin/main.ml @@ -1007,7 +1007,7 @@ module Replace_comments = struct let replace_comments = let doc = "replaces the comments of the specified secret, keeping the secret." in - let info = Cmd.info "replace-cmt" ~doc in + let info = Cmd.info "replace-comment" ~doc in let term = main_run Term.(const replace_comment $ Flags.secret_name) in Cmd.v info term end diff --git a/tests/replace_cmt_command.t b/tests/replace_comment_command.t similarity index 79% rename from tests/replace_cmt_command.t rename to tests/replace_comment_command.t index 4b5f08f..064bf1b 100644 --- a/tests/replace_cmt_command.t +++ b/tests/replace_comment_command.t @@ -1,31 +1,31 @@ $ . ./setup_fixtures.sh Should fail - replace comments of a non-existing secret in a new folder - redirects to passage create or new - $ echo "comment" | passage replace-cmt folder/new + $ echo "comment" | passage replace-comment folder/new E: No recipients found (use "passage {create,new} folder/new_secret_name" to use recipients associated with $PASSAGE_IDENTITY instead) [1] Should fail - replace comments of a non-existing secret - $ echo "comment" | passage replace-cmt 00/secret2 + $ echo "comment" | passage replace-comment 00/secret2 E: no such secret: 00/secret2 [1] Should succeed - replacing a the comments on a single-line secret without comments - $ echo "replaced comments" | passage replace-cmt 00/secret1 + $ echo "replaced comments" | passage replace-comment 00/secret1 $ passage cat 00/secret1 (00/secret1) secret: single line replaced comments Should succeed - replacing a the comments on a single-line secret with comments - $ echo "replaced again comments" | passage replace-cmt 00/secret1 + $ echo "replaced again comments" | passage replace-comment 00/secret1 $ passage cat 00/secret1 (00/secret1) secret: single line replaced again comments Should succeed - replacing single-line comments with multiline comments - $ echo "replaced again comments\nline 2" | passage replace-cmt 00/secret1 + $ echo "replaced again comments\nline 2" | passage replace-comment 00/secret1 $ passage cat 00/secret1 (00/secret1) secret: single line @@ -33,7 +33,7 @@ Should succeed - replacing single-line comments with multiline comments line 2 Should succeed - replacing multiline comments with multiline comments - $ echo "new comments\nline 2 of said new comments" | passage replace-cmt 00/secret1 + $ echo "new comments\nline 2 of said new comments" | passage replace-comment 00/secret1 $ passage cat 00/secret1 (00/secret1) secret: single line @@ -42,7 +42,7 @@ Should succeed - replacing multiline comments with multiline comments Should succeed - replacing multiline comments with multiline comments - in multiline secret $ setup_multiline_secret_with_comments 00/secret2 - $ echo "new comments\nline 2 of said new comments" | passage replace-cmt 00/secret2 + $ echo "new comments\nline 2 of said new comments" | passage replace-comment 00/secret2 $ passage cat 00/secret2 new comments @@ -52,7 +52,7 @@ Should succeed - replacing multiline comments with multiline comments - in multi (00/secret2) secret: line 2 Should fail - comments with empty lines in the middle - $ echo "uno commento\n\ndos commentos" | passage replace-cmt 00/secret1 + $ echo "uno commento\n\ndos commentos" | passage replace-comment 00/secret1 The comments are in an invalid format: secrets cannot have empty lines in the middle of the comments [1] $ passage cat 00/secret1