fix: implement ps:restore

Also add all the niceties around parallelism that were introduced for the other commands.
This commit is contained in:
Jose Diaz-Gonzalez
2020-11-21 20:37:54 -05:00
parent 8ae597ad1d
commit ab0cc6c444
3 changed files with 67 additions and 3 deletions

View File

@@ -44,9 +44,11 @@ func main() {
err = ps.CommandRestart(appName, *allApps, *parallelCount)
case "restore":
args := flag.NewFlagSet("ps:restore", flag.ExitOnError)
allApps := args.Bool("all", false, "--all: restore all apps")
parallelCount := args.Int("parallel", ps.RunInSerial, "--parallel: number of apps to restore in parallel, -1 to match cpu count")
args.Parse(os.Args[2:])
appName := args.Arg(0)
err = ps.CommandRestore(appName)
err = ps.CommandRestore(appName, *allApps, *parallelCount)
case "retire":
args := flag.NewFlagSet("ps:retire", flag.ExitOnError)
args.Parse(os.Args[2:])