| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package main | 5 package main |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "errors" | 8 "errors" |
| 9 "flag" | 9 "flag" |
| 10 "fmt" | 10 "fmt" |
| 11 "runtime" |
| 11 | 12 |
| 12 "github.com/luci/luci-go/client/internal/common" | 13 "github.com/luci/luci-go/client/internal/common" |
| 13 "github.com/luci/luci-go/client/isolate" | 14 "github.com/luci/luci-go/client/isolate" |
| 14 "github.com/luci/luci-go/client/isolatedclient" | 15 "github.com/luci/luci-go/client/isolatedclient" |
| 15 "github.com/maruel/subcommands" | 16 "github.com/maruel/subcommands" |
| 16 ) | 17 ) |
| 17 | 18 |
| 19 func init() { |
| 20 runtime.GOMAXPROCS(runtime.NumCPU()) |
| 21 } |
| 22 |
| 18 type commonFlags struct { | 23 type commonFlags struct { |
| 19 subcommands.CommandRunBase | 24 subcommands.CommandRunBase |
| 20 defaultFlags common.Flags | 25 defaultFlags common.Flags |
| 21 } | 26 } |
| 22 | 27 |
| 23 func (c *commonFlags) Init() { | 28 func (c *commonFlags) Init() { |
| 24 c.defaultFlags.Init(&c.Flags) | 29 c.defaultFlags.Init(&c.Flags) |
| 25 } | 30 } |
| 26 | 31 |
| 27 func (c *commonFlags) Parse() error { | 32 func (c *commonFlags) Parse() error { |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 | 111 |
| 107 if flags&RequireIsolateFile != 0 && c.Isolate == "" { | 112 if flags&RequireIsolateFile != 0 && c.Isolate == "" { |
| 108 return errors.New("-isolate must be specified") | 113 return errors.New("-isolate must be specified") |
| 109 } | 114 } |
| 110 if flags&RequireIsolatedFile != 0 && c.Isolated == "" { | 115 if flags&RequireIsolatedFile != 0 && c.Isolated == "" { |
| 111 return errors.New("-isolated must be specified") | 116 return errors.New("-isolated must be specified") |
| 112 } | 117 } |
| 113 | 118 |
| 114 return nil | 119 return nil |
| 115 } | 120 } |
| OLD | NEW |