Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --comment flag to create subcommand #30

Merged
merged 1 commit into from
Feb 9, 2021

Conversation

micnncim
Copy link
Contributor

@micnncim micnncim commented Feb 8, 2021

WHAT

Added --comment|-c flag to hclecit create.

$ go run ./cmd/hcledit/main.go create 'module.my-module.key' 'value' --comment '// Comment' ./cmd/hcledit/internal/command/fixture/file.tf

$ git --no-pager diff
diff --git a/cmd/hcledit/internal/command/fixture/file.tf b/cmd/hcledit/internal/command/fixture/file.tf
index 2d98c5c..7efd30b 100644
--- a/cmd/hcledit/internal/command/fixture/file.tf
+++ b/cmd/hcledit/internal/command/fixture/file.tf
@@ -29,4 +29,6 @@ module "my-module" {
       "f",
     ]
   }
+  // Comment
+  key = "value"
 }

WHY

From: #6

@micnncim micnncim self-assigned this Feb 8, 2021
@micnncim micnncim requested review from drlau and tcnksm February 8, 2021 09:25
@micnncim micnncim mentioned this pull request Feb 8, 2021
17 tasks
@micnncim micnncim merged commit f237f2c into main Feb 9, 2021
@micnncim micnncim deleted the micnncim/create-comment-flag branch February 9, 2021 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants