You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by gi...@git.apache.org on 2017/10/06 01:21:39 UTC

[GitHub] alexkli opened a new issue #2837: [cli] Support reading param.json from stdin

alexkli opened a new issue #2837: [cli] Support reading param.json from stdin
URL: https://github.com/apache/incubator-openwhisk/issues/2837
 
 
   It would be useful to support reading a parameter json file from stdin for various piping scenarios, using the convention of "-" as filename:
   
       cat some.json | envsubst | wsk action invoke my-action -P -
   
   In this example we can leverage `envsubst` to replace some environment variables in the file. Without being able to read from stdin, one has to push the content into create a temporary file, invoke and then delete the temp file again.
   
   From looking at the go cli code, it seems `readFile()` in [util.go](https://github.com/apache/incubator-openwhisk/blob/26146368f1dd07f817062e662db64c73a8d486d6/tools/cli/go-whisk-cli/commands/util.go#L829) could be adapted to leverage `ioutil.ReadAll(os.Stdin)` in case `filename == "-"`. One probably has to check if that is ok for all other `readFile()` usages, or if that should be a special option reserved for `-P --param-file` only.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services