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:
@@ -158,13 +158,13 @@ func CommandRetire(appName string) error {
|
||||
}
|
||||
|
||||
// CommandScale gets or sets how many instances of a given process to run
|
||||
func CommandScale(appName string, skipDeploy bool, processTuples []string) error {
|
||||
func CommandScale(appName string, skipDeploy bool, format string, processTuples []string) error {
|
||||
if err := common.VerifyAppName(appName); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(processTuples) == 0 {
|
||||
return scaleReport(appName)
|
||||
return scaleReport(appName, format)
|
||||
}
|
||||
|
||||
if !canScaleApp(appName) {
|
||||
|
||||
Reference in New Issue
Block a user