mattolenik / hclq

Command-line processor for HashiCorp config files, like sed for HCL — Terraform, Consul, Nomad, Vault
https://hclq.sh
The Unlicense
252 stars 23 forks source link

acutally read the -d DESTINATION and -a ARCH arguments #25

Open dotysan opened 2 years ago

dotysan commented 2 years ago

Needed trailing colon (:) for those args.

kumadee commented 12 months ago

@mattolenik Could you please merge this?

kumadee commented 12 months ago

Please ignore my above comment.

To others who come here, please take a look at https://github.com/hashicorp/hcl/tree/main/cmd/hcldec as an alternative.

mvk commented 9 months ago

@mattolenik , the PR looks correct, getopts needs : after the options followed by OPTARG, meaning the diff should show:

diff --git a/install.sh b/install.sh
index b6fc803..8e00db5 100755
--- a/install.sh
+++ b/install.sh
@@ -46,7 +46,7 @@ platform_check() {
 main() {
   platform_check

-  while getopts ":qhdao:" opt; do
+  while getopts ":qhd:a:o:" opt; do
     case $opt in
       q) QUIET=true ;;
       d) DESTINATION="$OPTARG" ;;