feat: allow formatting :report command output as json

This commit is contained in:
Jose Diaz-Gonzalez
2021-02-01 22:23:05 -05:00
parent cc2f054e6a
commit 033b0952dd
34 changed files with 104 additions and 58 deletions

View File

@@ -24,21 +24,21 @@ func CommandLimitClear(appName string, processType string) error {
}
// CommandReport displays a resource report for one or more apps
func CommandReport(appName string, infoFlag string) error {
func CommandReport(appName string, format string, infoFlag string) error {
if len(appName) == 0 {
apps, err := common.DokkuApps()
if err != nil {
return err
}
for _, appName := range apps {
if err := ReportSingleApp(appName, infoFlag); err != nil {
if err := ReportSingleApp(appName, format, infoFlag); err != nil {
return err
}
}
return nil
}
return ReportSingleApp(appName, infoFlag)
return ReportSingleApp(appName, format, infoFlag)
}
// CommandReserve implements resource:reserve