hashicorp / hashicorp/envconsul

Add format option for env command

Open
#253 1 comment 0 reactions 0 assignees View on GitHub
question
Dominant language
Go
Stars
2.1k
Forks
194
PR merge metrics
No merged PRs in 30d

Description

### Expected behavior
I would like to be able to format the output of `envconsul env`. Currently it outputs the following:
```
MY_SERVICE_URL=http://my-service-v2:8080/
SVC_KEY_P12=MIIQYQIBAzCCECcGCSqGSIb3DQEHAaCCEBgEghAUMIIQEDCCBkcGCSqGSIb3DQEHBqCCBjgwggY0
AgEAMIIGLQYJKoZIhvcNAQcBMBwGCiqGSIb3DQEMAQYwDgQIn5LPw/Y+X3YCAggAgIIGAC0mH42g
qRZFopAvv/zNu8Pyn8K7kGBTO2kolHhOI6IjondOiNOCGLbZDxgicAO2cVbA0YfLdopB78GKRSeI
6k1o7cb2H7a4I/ncEjVLcZOoOWYzi1hfY7CfjIPjpjRAp6b0eqL7krO6U+By340vbPjUHL4hQY2t
MY_SERVICE_PORT=8080
```

### Actual behavior
I would like to print in JSON or some other easily parsable format, ie:
```JSON
{
"MY_SERVICE_URL": "http://my-service-v2:8080/",
"SVC_KEY_P12": "MIIQYQIBAzCCECcGCSqGSIb3DQEHAaCCEBgEghAUMIIQEDCCBkcGCSqGSIb3DQEHBqCCBjgwggY0
AgEAMIIGLQYJKoZIhvcNAQcBMBwGCiqGSIb3DQEMAQYwDgQIn5LPw/Y+X3YCAggAgIIGAC0mH42g
qRZFopAvv/zNu8Pyn8K7kGBTO2kolHhOI6IjondOiNOCGLbZDxgicAO2cVbA0YfLdopB78GKRSeI
6k1o7cb2H7a4I/ncEjVLcZOoOWYzi1hfY7CfjIPjpjRAp6b0eqL7krO6U+By340vbPjUHL4hQY2t",
"MY_SERVICE_PORT": 8080
}
```

The issue is I cannot easily parse multi-line values. As you can see the SVC_KEY_P12 comes across 4 separate lines (though really a P12 would be many more than 4 lines), but there's not really a way to tell that that all of that is a single variable since every each variable is on it's own new line, making it looks like it's a separate variable.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.