feat: add --format json support to ps:scale
The `ps:scale` command now accepts a `--format` flag that defaults to `stdout` and can be set to `json` to emit the current formation as a JSON array of process type and quantity objects, matching the JSON output the `:report` subcommands already provide. The flag only applies when displaying the current formation; it is ignored when process types are supplied for scaling. When no scale has been set for the app, the JSON output is an empty array.
This commit is contained in:
6 files changed
+74
-14
No files matched your search
@@ -65,10 +65,11 @@ func main() {
|
||||
case "scale":
|
||||
args := flag.NewFlagSet("ps:scale", flag.ExitOnError)
|
||||
skipDeploy := args.Bool("skip-deploy", false, "--skip-deploy: skip deploy of the app")
|
||||
format := args.String("format", "stdout", "format: [ stdout | json ]")
|
||||
args.Parse(os.Args[2:])
|
||||
appName := args.Arg(0)
|
||||
_, processTuples := common.ShiftString(args.Args())
|
||||
err = ps.CommandScale(appName, *skipDeploy, processTuples)
|
||||
err = ps.CommandScale(appName, *skipDeploy, *format, processTuples)
|
||||
case "set":
|
||||
args := flag.NewFlagSet("ps:set", flag.ExitOnError)
|
||||
global := args.Bool("global", false, "--global: set a global property")
|
||||
|
||||
Reference in new issue
Block a user