{"action":"created","issue":{"url":"https://api.github.com/repos/Luzifer/vault2env/issues/1","repository_url":"https://api.github.com/repos/Luzifer/vault2env","labels_url":"https://api.github.com/repos/Luzifer/vault2env/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/Luzifer/vault2env/issues/1/comments","events_url":"https://api.github.com/repos/Luzifer/vault2env/issues/1/events","html_url":"https://github.com/Luzifer/vault2env/issues/1","id":366500497,"node_id":"MDU6SXNzdWUzNjY1MDA0OTc=","number":1,"title":"Command with arguments","user":{"login":"kakoni","id":812150,"node_id":"MDQ6VXNlcjgxMjE1MA==","avatar_url":"https://avatars2.githubusercontent.com/u/812150?v=4","gravatar_id":"","url":"https://api.github.com/users/kakoni","html_url":"https://github.com/kakoni","followers_url":"https://api.github.com/users/kakoni/followers","following_url":"https://api.github.com/users/kakoni/following{/other_user}","gists_url":"https://api.github.com/users/kakoni/gists{/gist_id}","starred_url":"https://api.github.com/users/kakoni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kakoni/subscriptions","organizations_url":"https://api.github.com/users/kakoni/orgs","repos_url":"https://api.github.com/users/kakoni/repos","events_url":"https://api.github.com/users/kakoni/events{/privacy}","received_events_url":"https://api.github.com/users/kakoni/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-10-03T19:51:53Z","updated_at":"2018-10-04T10:48:35Z","closed_at":"2018-10-03T21:25:31Z","author_association":"NONE","body":"Interesting and useful project, thanks.\r\n\r\nWhen trying to run command with arguments, vault2env fails =>\r\n```shell\r\nvault2env --key=secret/mysql ls -la    \r\nunknown shorthand flag: 'l' in -la\r\n```\r\n\r\nEscaping won't help\r\n```shell\r\nvault2env --key=secret/mysql \"ls -la\"    \r\nFATA[0000] exec: \"ls -la\": executable file not found in $PATH\r\n```"},"comment":{"url":"https://api.github.com/repos/Luzifer/vault2env/issues/comments/426972322","html_url":"https://github.com/Luzifer/vault2env/issues/1#issuecomment-426972322","issue_url":"https://api.github.com/repos/Luzifer/vault2env/issues/1","id":426972322,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNjk3MjMyMg==","user":{"login":"Luzifer","id":20142,"node_id":"MDQ6VXNlcjIwMTQy","avatar_url":"https://avatars2.githubusercontent.com/u/20142?v=4","gravatar_id":"","url":"https://api.github.com/users/Luzifer","html_url":"https://github.com/Luzifer","followers_url":"https://api.github.com/users/Luzifer/followers","following_url":"https://api.github.com/users/Luzifer/following{/other_user}","gists_url":"https://api.github.com/users/Luzifer/gists{/gist_id}","starred_url":"https://api.github.com/users/Luzifer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Luzifer/subscriptions","organizations_url":"https://api.github.com/users/Luzifer/orgs","repos_url":"https://api.github.com/users/Luzifer/repos","events_url":"https://api.github.com/users/Luzifer/events{/privacy}","received_events_url":"https://api.github.com/users/Luzifer/received_events","type":"User","site_admin":false},"created_at":"2018-10-04T10:48:35Z","updated_at":"2018-10-04T10:48:35Z","author_association":"OWNER","body":"As those values are inserted into the env and your variables are evaluated by the surrounding shell this does not work as expected. You can wrap the command with another shell as a \"workaround\" to get it working:\r\n\r\n```console\r\n$ vault write secret/example username=myuser password=mypass\r\nSuccess! Data written to: secret/example\r\n\r\n$ vault2env --key=secret/example -- echo \"$username:$password\"\r\n:\r\n\r\n$ vault2env --key=secret/example -- bash -ec 'echo \"$username:$password\"'\r\nmyuser:mypass\r\n```"}}
{"actor":{"display_login":"Luzifer"}}