| OLD | NEW |
| 1 // Copyright 2015 The LUCI Authors. All rights reserved. | 1 // Copyright 2016 The LUCI Authors. All rights reserved. |
| 2 // Use of this source code is governed under the Apache License, Version 2.0 | 2 // Use of this source code is governed under the Apache License, Version 2.0 |
| 3 // that can be found in the LICENSE file. | 3 // that can be found in the LICENSE file. |
| 4 | 4 |
| 5 package main | 5 package main |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "log" | 8 "log" |
| 9 "os" | 9 "os" |
| 10 | 10 |
| 11 "github.com/luci/luci-go/client/authcli" | 11 "github.com/luci/luci-go/client/authcli" |
| 12 "github.com/luci/luci-go/client/internal/common" | 12 "github.com/luci/luci-go/client/internal/common" |
| 13 "github.com/luci/luci-go/common/auth" | 13 "github.com/luci/luci-go/common/auth" |
| 14 "github.com/maruel/subcommands" | 14 "github.com/maruel/subcommands" |
| 15 ) | 15 ) |
| 16 | 16 |
| 17 // version must be updated whenever functional change (behavior, arguments, | 17 // version must be updated whenever functional change (behavior, arguments, |
| 18 // supported commands) is done. | 18 // supported commands) is done. |
| 19 const version = "0.3" | 19 const version = "0.3" |
| 20 | 20 |
| 21 var application = &subcommands.DefaultApplication{ | 21 var application = &subcommands.DefaultApplication{ |
| 22 Name: "isolate", | 22 Name: "isolate", |
| 23 Title: "isolate.py but faster", | 23 Title: "isolate.py but faster", |
| 24 // Keep in alphabetical order of their name. | 24 // Keep in alphabetical order of their name. |
| 25 Commands: []*subcommands.Command{ | 25 Commands: []*subcommands.Command{ |
| 26 cmdArchive, | 26 cmdArchive, |
| 27 cmdFastArchive, |
| 27 cmdBatchArchive, | 28 cmdBatchArchive, |
| 28 cmdCheck, | 29 cmdCheck, |
| 29 subcommands.CmdHelp, | 30 subcommands.CmdHelp, |
| 30 authcli.SubcommandInfo(auth.Options{}, "whoami"), | 31 authcli.SubcommandInfo(auth.Options{}, "whoami"), |
| 31 authcli.SubcommandLogin(auth.Options{}, "login"), | 32 authcli.SubcommandLogin(auth.Options{}, "login"), |
| 32 authcli.SubcommandLogout(auth.Options{}, "logout"), | 33 authcli.SubcommandLogout(auth.Options{}, "logout"), |
| 33 common.CmdVersion(version), | 34 common.CmdVersion(version), |
| 34 }, | 35 }, |
| 35 } | 36 } |
| 36 | 37 |
| 37 func main() { | 38 func main() { |
| 38 log.SetFlags(log.Lmicroseconds) | 39 log.SetFlags(log.Lmicroseconds) |
| 39 os.Exit(subcommands.Run(application, nil)) | 40 os.Exit(subcommands.Run(application, nil)) |
| 40 } | 41 } |
| OLD | NEW |