You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/04/02 15:58:31 UTC

[GitHub] dubee closed pull request #2848: Support reading param.json from stdin #2837

dubee closed pull request #2848: Support reading param.json from stdin #2837
URL: https://github.com/apache/incubator-openwhisk/pull/2848
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/docs/actions.md b/docs/actions.md
index a1d161e137..fe4b0b7c40 100644
--- a/docs/actions.md
+++ b/docs/actions.md
@@ -202,6 +202,39 @@ Parameters can be passed to the action when it is invoked.
       "payload": "Hello, Bernie from Vermont"
   }
   ```
+4.  It is possible to pipe JSON parameters to the `wsk` command by using the special filename `-` with `--params-file` or `-P`:
+  
+  ```
+  cat parameters.json | envsubst | wsk action invoke -r hello -P -
+  ```
+  
+  This example uses `envsubst` to replace environment variables in the JSON before passing them to the action invocation.
+
+  Other cases for piping might be preprocessing using tools such as [jq](https://stedolan.github.io/jq/).
+    
+  To complete the example, the environment variable might be set on the command line:
+  
+  ```
+  export NAME=Alice
+  ```
+
+  And the json would look like this:
+  
+  ```json
+  {
+      "name": "$NAME",
+      "place": "Vermont"
+  }
+  ```
+  
+  This would result in:
+  
+  ```json
+  {
+      "payload": "Hello, Alice from Vermont"
+  }
+  ```
+
 
 ### Setting default parameters
 
diff --git a/tests/src/test/scala/common/BaseWsk.scala b/tests/src/test/scala/common/BaseWsk.scala
index 9d7cafe980..d9429ca3a0 100644
--- a/tests/src/test/scala/common/BaseWsk.scala
+++ b/tests/src/test/scala/common/BaseWsk.scala
@@ -204,6 +204,7 @@ trait BaseAction extends BaseRunWsk with BaseDeleteFromCollection with BaseListO
              shared: Option[Boolean] = None,
              update: Boolean = false,
              web: Option[String] = None,
+             stdinFile: Option[File] = None,
              expectedExitCode: Int = SUCCESS_EXIT)(implicit wp: WskProps): RunResult
 
   def invoke(name: String,
@@ -211,6 +212,7 @@ trait BaseAction extends BaseRunWsk with BaseDeleteFromCollection with BaseListO
              parameterFile: Option[String] = None,
              blocking: Boolean = false,
              result: Boolean = false,
+             stdinFile: Option[File] = None,
              expectedExitCode: Int = SUCCESS_EXIT)(implicit wp: WskProps): RunResult
 }
 
@@ -223,6 +225,7 @@ trait BasePackage extends BaseRunWsk with BaseDeleteFromCollection with BaseList
              annotationFile: Option[String] = None,
              shared: Option[Boolean] = None,
              update: Boolean = false,
+             stdinFile: Option[File] = None,
              expectedExitCode: Int = SUCCESS_EXIT)(implicit wp: WskProps): RunResult
 
   def bind(provider: String,
@@ -242,6 +245,7 @@ trait BaseTrigger extends BaseRunWsk with BaseDeleteFromCollection with BaseList
              feed: Option[String] = None,
              shared: Option[Boolean] = None,
              update: Boolean = false,
+             stdinFile: Option[File] = None,
              expectedExitCode: Int = SUCCESS_EXIT)(implicit wp: WskProps): RunResult
 
   def fire(name: String,
diff --git a/tests/src/test/scala/common/Wsk.scala b/tests/src/test/scala/common/Wsk.scala
index 50a501f26b..55878dae36 100644
--- a/tests/src/test/scala/common/Wsk.scala
+++ b/tests/src/test/scala/common/Wsk.scala
@@ -249,6 +249,7 @@ class WskAction()
     shared: Option[Boolean] = None,
     update: Boolean = false,
     web: Option[String] = None,
+    stdinFile: Option[File] = None,
     expectedExitCode: Int = SUCCESS_EXIT)(implicit wp: WskProps): RunResult = {
     val params = Seq(noun, if (!update) "create" else "update", "--auth", wp.authKey, fqn(name)) ++ {
       artifact map { Seq(_) } getOrElse Seq()
@@ -302,7 +303,7 @@ class WskAction()
         Seq("--web", w)
       } getOrElse Seq()
     }
-    cli(wp.overrides ++ params, expectedExitCode)
+    cli(wp.overrides ++ params, expectedExitCode, stdinFile = stdinFile)
   }
 
   /**
@@ -317,6 +318,7 @@ class WskAction()
                       parameterFile: Option[String] = None,
                       blocking: Boolean = false,
                       result: Boolean = false,
+                      stdinFile: Option[File] = None,
                       expectedExitCode: Int = SUCCESS_EXIT)(implicit wp: WskProps): RunResult = {
     val params = Seq(noun, "invoke", "--auth", wp.authKey, fqn(name)) ++ {
       parameters flatMap { p =>
@@ -327,7 +329,7 @@ class WskAction()
         Seq("-P", pf)
       } getOrElse Seq()
     } ++ { if (blocking) Seq("--blocking") else Seq() } ++ { if (result) Seq("--result") else Seq() }
-    cli(wp.overrides ++ params, expectedExitCode)
+    cli(wp.overrides ++ params, expectedExitCode, stdinFile = stdinFile)
   }
 }
 
@@ -355,6 +357,7 @@ class WskTrigger()
                       feed: Option[String] = None,
                       shared: Option[Boolean] = None,
                       update: Boolean = false,
+                      stdinFile: Option[File] = None,
                       expectedExitCode: Int = SUCCESS_EXIT)(implicit wp: WskProps): RunResult = {
     val params = Seq(noun, if (!update) "create" else "update", "--auth", wp.authKey, fqn(name)) ++ {
       feed map { f =>
@@ -381,7 +384,7 @@ class WskTrigger()
         Seq("--shared", if (s) "yes" else "no")
       } getOrElse Seq()
     }
-    cli(wp.overrides ++ params, expectedExitCode)
+    cli(wp.overrides ++ params, expectedExitCode, stdinFile = stdinFile)
   }
 
   /**
@@ -767,6 +770,7 @@ class WskPackage() extends RunWskCmd with ListOrGetFromCollectionCLI with Delete
                       annotationFile: Option[String] = None,
                       shared: Option[Boolean] = None,
                       update: Boolean = false,
+                      stdinFile: Option[File] = None,
                       expectedExitCode: Int = SUCCESS_EXIT)(implicit wp: WskProps): RunResult = {
     val params = Seq(noun, if (!update) "create" else "update", "--auth", wp.authKey, fqn(name)) ++ {
       parameters flatMap { p =>
@@ -789,7 +793,7 @@ class WskPackage() extends RunWskCmd with ListOrGetFromCollectionCLI with Delete
         Seq("--shared", if (s) "yes" else "no")
       } getOrElse Seq()
     }
-    cli(wp.overrides ++ params, expectedExitCode)
+    cli(wp.overrides ++ params, expectedExitCode, stdinFile = stdinFile)
   }
 
   /**
diff --git a/tests/src/test/scala/whisk/core/cli/test/WskBasicUsageTests.scala b/tests/src/test/scala/whisk/core/cli/test/WskBasicUsageTests.scala
index 85e9fc88d8..c54385bb98 100644
--- a/tests/src/test/scala/whisk/core/cli/test/WskBasicUsageTests.scala
+++ b/tests/src/test/scala/whisk/core/cli/test/WskBasicUsageTests.scala
@@ -213,6 +213,27 @@ class WskBasicUsageTests extends TestHelpers with WskTestHelpers {
       }
   }
 
+  it should "create, and get an action to verify file parameter passed via stdin" in withAssetCleaner(wskprops) {
+    (wp, assetHelper) =>
+      val name = "actionParamsViaStdin"
+      val file = Some(TestUtils.getTestActionFilename("hello.js"))
+      val argInput = Some(TestUtils.getTestActionFilename("validInput1.json"))
+
+      assetHelper.withCleaner(wsk.action, name) { (action, _) =>
+        action.create(name, file, parameterFile = Some("-"), stdinFile = Some(new File(argInput.get)))
+      }
+
+      val stdout = wsk.action.get(name).stdout
+      assert(stdout.startsWith(s"ok: got action $name\n"))
+
+      val receivedParams = wsk.parseJsonString(stdout).fields("parameters").convertTo[JsArray].elements
+      val escapedJSONArr = getJSONFileOutput.convertTo[JsArray].elements
+
+      for (expectedItem <- escapedJSONArr) {
+        receivedParams should contain(expectedItem)
+      }
+  }
+
   it should "create an action with the proper parameter and annotation escapes" in withAssetCleaner(wskprops) {
     (wp, assetHelper) =>
       val name = "actionEscapes"
@@ -479,6 +500,28 @@ class WskBasicUsageTests extends TestHelpers with WskTestHelpers {
       run.stdout.parseJson shouldBe args.toJson
   }
 
+  it should "invoke an action successfully with file parameters" in withAssetCleaner(wskprops) { (wp, assetHelper) =>
+    val name = "invokeResult"
+    assetHelper.withCleaner(wsk.action, name) { (action, _) =>
+      action.create(name, Some(TestUtils.getTestActionFilename("echo.js")))
+    }
+    val paramFile = Some(TestUtils.getTestActionFilename("validInput2.json"))
+    val run = wsk.action.invoke(name, blocking = true, result = true, parameterFile = paramFile)
+    run.stdout.parseJson shouldBe Map("payload" -> "test".toJson).toJson
+  }
+
+  it should "invoke an action successfully with parameters passed via stdin" in withAssetCleaner(wskprops) {
+    (wp, assetHelper) =>
+      val name = "invokeResult"
+      assetHelper.withCleaner(wsk.action, name) { (action, _) =>
+        action.create(name, Some(TestUtils.getTestActionFilename("echo.js")))
+      }
+      val paramFile = Some(new File(TestUtils.getTestActionFilename("validInput2.json")))
+      val run =
+        wsk.action.invoke(name, blocking = true, result = true, parameterFile = Some("-"), stdinFile = paramFile)
+      run.stdout.parseJson shouldBe Map("payload" -> "test".toJson).toJson
+  }
+
   it should "invoke an action that returns a result by the deadline" in withAssetCleaner(wskprops) {
     (wp, assetHelper) =>
       val name = "deadline"
@@ -940,6 +983,27 @@ class WskBasicUsageTests extends TestHelpers with WskTestHelpers {
       }
   }
 
+  it should "create, and get a package to verify file parameter passed via stdin" in withAssetCleaner(wskprops) {
+    (wp, assetHelper) =>
+      val name = "packageParamsViaStdin"
+      val file = Some(TestUtils.getTestActionFilename("hello.js"))
+      val argInput = Some(TestUtils.getTestActionFilename("validInput1.json"))
+
+      assetHelper.withCleaner(wsk.pkg, name) { (pkg, _) =>
+        pkg.create(name, parameterFile = Some("-"), stdinFile = Some(new File(argInput.get)))
+      }
+
+      val stdout = wsk.pkg.get(name).stdout
+      assert(stdout.startsWith(s"ok: got package $name\n"))
+
+      val receivedParams = wsk.parseJsonString(stdout).fields("parameters").convertTo[JsArray].elements
+      val escapedJSONArr = getJSONFileOutput.convertTo[JsArray].elements
+
+      for (expectedItem <- escapedJSONArr) {
+        receivedParams should contain(expectedItem)
+      }
+  }
+
   it should "create a package with the proper parameter and annotation escapes" in withAssetCleaner(wskprops) {
     (wp, assetHelper) =>
       val name = "packageEscapses"
@@ -1080,6 +1144,27 @@ class WskBasicUsageTests extends TestHelpers with WskTestHelpers {
       }
   }
 
+  it should "create, and get a trigger to verify file parameter passed via stdin" in withAssetCleaner(wskprops) {
+    (wp, assetHelper) =>
+      val name = "triggerParamsViaStdin"
+      val file = Some(TestUtils.getTestActionFilename("hello.js"))
+      val argInput = Some(TestUtils.getTestActionFilename("validInput1.json"))
+
+      assetHelper.withCleaner(wsk.trigger, name) { (trigger, _) =>
+        trigger.create(name, parameterFile = Some("-"), stdinFile = Some(new File(argInput.get)))
+      }
+
+      val stdout = wsk.trigger.get(name).stdout
+      assert(stdout.startsWith(s"ok: got trigger $name\n"))
+
+      val receivedParams = wsk.parseJsonString(stdout).fields("parameters").convertTo[JsArray].elements
+      val escapedJSONArr = getJSONFileOutput.convertTo[JsArray].elements
+
+      for (expectedItem <- escapedJSONArr) {
+        receivedParams should contain(expectedItem)
+      }
+  }
+
   it should "display a trigger summary when --summary flag is used with 'wsk trigger get'" in withAssetCleaner(wskprops) {
     (wp, assetHelper) =>
       val triggerName = "mySummaryTrigger"
diff --git a/tools/cli/go-whisk-cli/commands/action.go b/tools/cli/go-whisk-cli/commands/action.go
index 05febd85d1..f5af224312 100644
--- a/tools/cli/go-whisk-cli/commands/action.go
+++ b/tools/cli/go-whisk-cli/commands/action.go
@@ -1045,7 +1045,7 @@ func init() {
     actionCreateCmd.Flags().StringSliceVarP(&flags.common.annotation, "annotation", "a", nil, wski18n.T("annotation values in `KEY VALUE` format"))
     actionCreateCmd.Flags().StringVarP(&flags.common.annotFile, "annotation-file", "A", "", wski18n.T("`FILE` containing annotation values in JSON format"))
     actionCreateCmd.Flags().StringSliceVarP(&flags.common.param, "param", "p", nil, wski18n.T("parameter values in `KEY VALUE` format"))
-    actionCreateCmd.Flags().StringVarP(&flags.common.paramFile, "param-file", "P", "", wski18n.T("`FILE` containing parameter values in JSON format"))
+    actionCreateCmd.Flags().StringVarP(&flags.common.paramFile, "param-file", "P", "", wski18n.T("`FILE` containing parameter values in JSON format, use '-' to read from stdin"))
     actionCreateCmd.Flags().StringVar(&flags.action.web, WEB_FLAG, "", wski18n.T("treat ACTION as a web action, a raw HTTP web action, or as a standard action; yes | true = web action, raw = raw HTTP web action, no | false = standard action"))
 
     actionUpdateCmd.Flags().BoolVar(&flags.action.native, "native", false, wski18n.T("treat ACTION as native action (zip file provides a compatible executable to run)"))
@@ -1060,11 +1060,11 @@ func init() {
     actionUpdateCmd.Flags().StringSliceVarP(&flags.common.annotation, "annotation", "a", []string{}, wski18n.T("annotation values in `KEY VALUE` format"))
     actionUpdateCmd.Flags().StringVarP(&flags.common.annotFile, "annotation-file", "A", "", wski18n.T("`FILE` containing annotation values in JSON format"))
     actionUpdateCmd.Flags().StringSliceVarP(&flags.common.param, "param", "p", []string{}, wski18n.T("parameter values in `KEY VALUE` format"))
-    actionUpdateCmd.Flags().StringVarP(&flags.common.paramFile, "param-file", "P", "", wski18n.T("`FILE` containing parameter values in JSON format"))
+    actionUpdateCmd.Flags().StringVarP(&flags.common.paramFile, "param-file", "P", "", wski18n.T("`FILE` containing parameter values in JSON format, use '-' to read from stdin"))
     actionUpdateCmd.Flags().StringVar(&flags.action.web, WEB_FLAG, "", wski18n.T("treat ACTION as a web action, a raw HTTP web action, or as a standard action; yes | true = web action, raw = raw HTTP web action, no | false = standard action"))
 
     actionInvokeCmd.Flags().StringSliceVarP(&flags.common.param, "param", "p", []string{}, wski18n.T("parameter values in `KEY VALUE` format"))
-    actionInvokeCmd.Flags().StringVarP(&flags.common.paramFile, "param-file", "P", "", wski18n.T("`FILE` containing parameter values in JSON format"))
+    actionInvokeCmd.Flags().StringVarP(&flags.common.paramFile, "param-file", "P", "", wski18n.T("`FILE` containing parameter values in JSON format, use '-' to read from stdin"))
     actionInvokeCmd.Flags().BoolVarP(&flags.common.blocking, "blocking", "b", false, wski18n.T("blocking invoke"))
     actionInvokeCmd.Flags().BoolVarP(&flags.action.result, "result", "r", false, wski18n.T("blocking invoke; show only activation result (unless there is a failure)"))
 
diff --git a/tools/cli/go-whisk-cli/commands/commands.go b/tools/cli/go-whisk-cli/commands/commands.go
index 991e4d373c..b37e0a1820 100644
--- a/tools/cli/go-whisk-cli/commands/commands.go
+++ b/tools/cli/go-whisk-cli/commands/commands.go
@@ -21,6 +21,7 @@ import (
     "errors"
     "net/http"
     "os"
+    "io/ioutil"
 
     "../../go-whisk/whisk"
     "../wski18n"
@@ -138,10 +139,24 @@ func parseArgs(args []string) ([]string, []string, []string, error) {
             }
 
             filename := paramArgs[len(paramArgs) - 1]
-            paramArgs[len(paramArgs) - 1], whiskErr = readFile(filename)
-            if whiskErr != nil {
-                whisk.Debug(whisk.DbgError, "readFile(%s) error: %s\n", filename, whiskErr)
-                return nil, nil, nil, whiskErr
+
+            // special filename "-" refers to reading from the process std input
+            if filename == "-" {
+                bytes, err := ioutil.ReadAll(os.Stdin)
+                if err != nil {
+                    whisk.Debug(whisk.DbgError, "ioutil.ReadAll(os.Stdin) error: %s\n", err)
+                    errMsg := wski18n.T("Cannot read from stdin: {{.err}}", map[string]interface{}{"err": err})
+                    whiskErr := whisk.MakeWskErrorFromWskError(errors.New(errMsg), err, whisk.EXIT_CODE_ERR_USAGE,
+                        whisk.DISPLAY_MSG, whisk.DISPLAY_USAGE)
+                    return nil, nil, nil, whiskErr
+                }
+                paramArgs[len(paramArgs) - 1] = string(bytes)
+            } else {
+                paramArgs[len(paramArgs) - 1], whiskErr = readFile(filename)
+                if whiskErr != nil {
+                    whisk.Debug(whisk.DbgError, "readFile(%s) error: %s\n", filename, whiskErr)
+                    return nil, nil, nil, whiskErr
+                }
             }
         } else if args[i] == "-A" || args[i] == "--annotation-file" {
             annotArgs, args, whiskErr = getValueFromArgs(args, i, annotArgs)
diff --git a/tools/cli/go-whisk-cli/commands/package.go b/tools/cli/go-whisk-cli/commands/package.go
index 4aad852dde..c23ae5024a 100644
--- a/tools/cli/go-whisk-cli/commands/package.go
+++ b/tools/cli/go-whisk-cli/commands/package.go
@@ -507,13 +507,13 @@ func init() {
   packageCreateCmd.Flags().StringSliceVarP(&flags.common.annotation, "annotation", "a", []string{}, wski18n.T("annotation values in `KEY VALUE` format"))
   packageCreateCmd.Flags().StringVarP(&flags.common.annotFile, "annotation-file", "A", "", wski18n.T("`FILE` containing annotation values in JSON format"))
   packageCreateCmd.Flags().StringSliceVarP(&flags.common.param, "param", "p", []string{}, wski18n.T("parameter values in `KEY VALUE` format"))
-  packageCreateCmd.Flags().StringVarP(&flags.common.paramFile, "param-file", "P", "", wski18n.T("`FILE` containing parameter values in JSON format"))
+  packageCreateCmd.Flags().StringVarP(&flags.common.paramFile, "param-file", "P", "", wski18n.T("`FILE` containing parameter values in JSON format, use '-' to read from stdin"))
   packageCreateCmd.Flags().StringVar(&flags.common.shared, "shared", "", wski18n.T("package visibility `SCOPE`; yes = shared, no = private"))
 
   packageUpdateCmd.Flags().StringSliceVarP(&flags.common.annotation, "annotation", "a", []string{}, wski18n.T("annotation values in `KEY VALUE` format"))
   packageUpdateCmd.Flags().StringVarP(&flags.common.annotFile, "annotation-file", "A", "", wski18n.T("`FILE` containing annotation values in JSON format"))
   packageUpdateCmd.Flags().StringSliceVarP(&flags.common.param, "param", "p", []string{}, wski18n.T("parameter values in `KEY VALUE` format"))
-  packageUpdateCmd.Flags().StringVarP(&flags.common.paramFile, "param-file", "P", "", wski18n.T("`FILE` containing parameter values in JSON format"))
+  packageUpdateCmd.Flags().StringVarP(&flags.common.paramFile, "param-file", "P", "", wski18n.T("`FILE` containing parameter values in JSON format, use '-' to read from stdin"))
   packageUpdateCmd.Flags().StringVar(&flags.common.shared, "shared", "", wski18n.T("package visibility `SCOPE`; yes = shared, no = private"))
 
   packageGetCmd.Flags().BoolVarP(&flags.common.summary, "summary", "s", false, wski18n.T("summarize package details; parameters with prefix \"*\" are bound"))
@@ -521,7 +521,7 @@ func init() {
   packageBindCmd.Flags().StringSliceVarP(&flags.common.annotation, "annotation", "a", []string{}, wski18n.T("annotation values in `KEY VALUE` format"))
   packageBindCmd.Flags().StringVarP(&flags.common.annotFile, "annotation-file", "A", "", wski18n.T("`FILE` containing annotation values in JSON format"))
   packageBindCmd.Flags().StringSliceVarP(&flags.common.param, "param", "p", []string{}, wski18n.T("parameter values in `KEY VALUE` format"))
-  packageBindCmd.Flags().StringVarP(&flags.common.paramFile, "param-file", "P", "", wski18n.T("`FILE` containing parameter values in JSON format"))
+  packageBindCmd.Flags().StringVarP(&flags.common.paramFile, "param-file", "P", "", wski18n.T("`FILE` containing parameter values in JSON format, use '-' to read from stdin"))
 
   packageListCmd.Flags().IntVarP(&flags.common.skip, "skip", "s", 0, wski18n.T("exclude the first `SKIP` number of packages from the result"))
   packageListCmd.Flags().IntVarP(&flags.common.limit, "limit", "l", 30, wski18n.T("only return `LIMIT` number of packages from the collection"))
diff --git a/tools/cli/go-whisk-cli/commands/trigger.go b/tools/cli/go-whisk-cli/commands/trigger.go
index 7a464cef29..a158c33fd0 100644
--- a/tools/cli/go-whisk-cli/commands/trigger.go
+++ b/tools/cli/go-whisk-cli/commands/trigger.go
@@ -496,18 +496,18 @@ func init() {
     triggerCreateCmd.Flags().StringSliceVarP(&flags.common.annotation, "annotation", "a", []string{}, wski18n.T("annotation values in `KEY VALUE` format"))
     triggerCreateCmd.Flags().StringVarP(&flags.common.annotFile, "annotation-file", "A", "", wski18n.T("`FILE` containing annotation values in JSON format"))
     triggerCreateCmd.Flags().StringSliceVarP(&flags.common.param, "param", "p", []string{}, wski18n.T("parameter values in `KEY VALUE` format"))
-    triggerCreateCmd.Flags().StringVarP(&flags.common.paramFile, "param-file", "P", "", wski18n.T("`FILE` containing parameter values in JSON format"))
+    triggerCreateCmd.Flags().StringVarP(&flags.common.paramFile, "param-file", "P", "", wski18n.T("`FILE` containing parameter values in JSON format, use '-' to read from stdin"))
     triggerCreateCmd.Flags().StringVarP(&flags.common.feed, "feed", "f", "", wski18n.T("trigger feed `ACTION_NAME`"))
 
     triggerUpdateCmd.Flags().StringSliceVarP(&flags.common.annotation, "annotation", "a", []string{}, wski18n.T("annotation values in `KEY VALUE` format"))
     triggerUpdateCmd.Flags().StringVarP(&flags.common.annotFile, "annotation-file", "A", "", wski18n.T("`FILE` containing annotation values in JSON format"))
     triggerUpdateCmd.Flags().StringSliceVarP(&flags.common.param, "param", "p", []string{}, wski18n.T("parameter values in `KEY VALUE` format"))
-    triggerUpdateCmd.Flags().StringVarP(&flags.common.paramFile, "param-file", "P", "", wski18n.T("`FILE` containing parameter values in JSON format"))
+    triggerUpdateCmd.Flags().StringVarP(&flags.common.paramFile, "param-file", "P", "", wski18n.T("`FILE` containing parameter values in JSON format, use '-' to read from stdin"))
 
     triggerGetCmd.Flags().BoolVarP(&flags.trigger.summary, "summary", "s", false, wski18n.T("summarize trigger details; parameters with prefix \"*\" are bound"))
 
     triggerFireCmd.Flags().StringSliceVarP(&flags.common.param, "param", "p", []string{}, wski18n.T("parameter values in `KEY VALUE` format"))
-    triggerFireCmd.Flags().StringVarP(&flags.common.paramFile, "param-file", "P", "", wski18n.T("`FILE` containing parameter values in JSON format"))
+    triggerFireCmd.Flags().StringVarP(&flags.common.paramFile, "param-file", "P", "", wski18n.T("`FILE` containing parameter values in JSON format, use '-' to read from stdin"))
 
     triggerListCmd.Flags().IntVarP(&flags.common.skip, "skip", "s", 0, wski18n.T("exclude the first `SKIP` number of triggers from the result"))
     triggerListCmd.Flags().IntVarP(&flags.common.limit, "limit", "l", 30, wski18n.T("only return `LIMIT` number of triggers from the collection"))
diff --git a/tools/cli/go-whisk-cli/wski18n/resources/en_US.all.json b/tools/cli/go-whisk-cli/wski18n/resources/en_US.all.json
index acc6e2c075..5c11dac935 100644
--- a/tools/cli/go-whisk-cli/wski18n/resources/en_US.all.json
+++ b/tools/cli/go-whisk-cli/wski18n/resources/en_US.all.json
@@ -708,8 +708,8 @@
     "translation": "parameter values in `KEY VALUE` format"
   },
   {
-    "id": "`FILE` containing parameter values in JSON format",
-    "translation": "`FILE` containing parameter values in JSON format"
+    "id": "`FILE` containing parameter values in JSON format, use '-' to read from stdin",
+    "translation": "`FILE` containing parameter values in JSON format, use '-' to read from stdin"
   },
   {
     "id": "Arguments must be comma separated, and must be quoted if they contain spaces.",


 

----------------------------------------------------------------
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