Closed chiefy closed 7 years ago
Looking good. So no longer a work in progress?
@progrium nope, squashed my commits and I think it's more-or-less ready. Need to add some docs though.
FWIW - here's the results of a test I made
no args -----------------------------------
HOSTNAME=0e7dcb4ddcfc
SERVER_PORT=8080
HTTP_HOST=localhost
USER=e2eeea99-4a99-4496-969b-c93e466976e8
CMD_NAME=tester
REQUEST_URI=/run/chiefy/tester
SCRIPT_NAME=tester
PATH_INFO=/run/chiefy/tester
CMD_CHANNEL=dev
CMD_VERSION=dev
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PWD=/cmd
REMOTE_ADDR=
SHLVL=1
HOME=/root
SERVER_NAME=localhost
CONTENT_LENGTH=0
SERVER_SOFTWARE=cmd.io
QUERY_STRING=
GATEWAY_INTERFACE=CGI/1.1
SERVER_PROTOCOL=HTTP/1.1
CONTENT_TYPE=
REQUEST_METHOD=GET
_=/usr/bin/env
args:
-------------------------------------------
args query --------------------------------
HOSTNAME=269df05a85cb
SERVER_PORT=8080
HTTP_HOST=localhost
USER=e2eeea99-4a99-4496-969b-c93e466976e8
CMD_NAME=tester
REQUEST_URI=/run/chiefy/tester?args=hi%20how+yes%20asdf+some+other%20ones
SCRIPT_NAME=tester
PATH_INFO=/run/chiefy/tester
CMD_CHANNEL=dev
CMD_VERSION=dev
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PWD=/cmd
REMOTE_ADDR=
SHLVL=1
HOME=/root
SERVER_NAME=localhost
CONTENT_LENGTH=0
SERVER_SOFTWARE=cmd.io
QUERY_STRING=args=hi%20how+yes%20asdf+some+other%20ones
GATEWAY_INTERFACE=CGI/1.1
SERVER_PROTOCOL=HTTP/1.1
CONTENT_TYPE=
REQUEST_METHOD=GET
_=/usr/bin/env
args:
1-hi 2-how 3-yes 4-asdf 5-some 6-other 7-ones
-------------------------------------------
non-args query ----------------------------
HOSTNAME=5bced9581020
SERVER_PORT=8080
HTTP_HOST=localhost
USER=e2eeea99-4a99-4496-969b-c93e466976e8
CMD_NAME=tester
REQUEST_URI=/run/chiefy/tester?val=true&something=else&whatever=false+maybe
SCRIPT_NAME=tester
PATH_INFO=/run/chiefy/tester
CMD_CHANNEL=dev
CMD_VERSION=dev
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PWD=/cmd
REMOTE_ADDR=
SHLVL=1
HOME=/root
SERVER_NAME=localhost
CONTENT_LENGTH=0
SERVER_SOFTWARE=cmd.io
QUERY_STRING=val=true&something=else&whatever=false+maybe
GATEWAY_INTERFACE=CGI/1.1
SERVER_PROTOCOL=HTTP/1.1
CONTENT_TYPE=
REQUEST_METHOD=GET
_=/usr/bin/env
args:
-------------------------------------------
So cool! Now how do we get the request body into STDIN...
@progrium you mean for POST
requests? That's gonna be interesting.
Rebase and take a pass at docs ... maybe here: https://github.com/gliderlabs/cmd/blob/master/docs/api.md
@progrium updated docs - feedback much appreciated. Not sure if you think simpler example is needed?
Cool, great idea for the docs. I think we can simplify the Bash for both the command (maybe just call env
and echo "Args: $@"
) and creating the command (like just heredoc directly into SSH instead of making a var). And then the example running it could be collapsed from three into one that just describes args
vs query params, etc. A more detailed walkthrough can be put together later.
@chiefy I'd like to merge this, can you make those changes to simplify the docs?
@progrium updated PR.
I was expecting more to be cut. Try and edit it down more, otherwise we might not get this merged until one of us can take a stab at it.
@progrium I axed one of the example outputs, and omitted some of the ENV output from the examples. Other than that I am not sure what you are looking for here?
No that helps a lot, thanks!
Btw, @chiefy are you able to merge this? I guess a recent change to perms means only certain people can merge to master... just want to make sure. I'll merge if not.
CMD_
environment variables no matter what the context forcmd
name