diff --git a/README.md b/README.md index 87589ef..08f7d30 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ Options: posix, ruby, node, python, php, go, rust, docker -f, --format FORMAT Output in the specified format [default: sh] - sh, csh, fish, json, jsonl, yaml, name + sh, csh, fish, json, jsonl, yaml, name, php -e, --env ENV_PATH Location of the .env file [default: .env] Multiple -e options are allowed If the ENV_PATH is "-", read from stdin diff --git a/src/parser.awk b/src/parser.awk index eaf56a4..cd8ed56 100644 --- a/src/parser.awk +++ b/src/parser.awk @@ -159,6 +159,7 @@ function output(flag, key, value) { if (FORMAT == "json") output_json(flag, key, value) if (FORMAT == "jsonl") output_jsonl(flag, key, value) if (FORMAT == "yaml") output_yaml(flag, key, value) + if (FORMAT == "php") output_php(flag, key, value) if (FORMAT == "name") output_name_only(flag, key, value) } @@ -220,6 +221,19 @@ function output_yaml(flag, key, value) { } } +function output_php(flag, key, value) { + if (flag == BEFORE_ALL) { + print "