| OLD | NEW |
| 1 // Copyright 2015 The LUCI Authors. All rights reserved. | 1 // Copyright 2015 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.2" | 19 const version = "0.2" |
| 20 | 20 |
| 21 var application = &subcommands.DefaultApplication{ | 21 var application = &subcommands.DefaultApplication{ |
| 22 Name: "swarming", | 22 Name: "swarming", |
| 23 Title: "Client tool to access a swarming server.", | 23 Title: "Client tool to access a swarming server.", |
| 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 cmdRequestShow, | 26 cmdRequestShow, |
| 27 cmdTrigger, | 27 cmdTrigger, |
| 28 subcommands.CmdHelp, | 28 subcommands.CmdHelp, |
| 29 » » authcli.SubcommandInfo(auth.Options{}, "whoami"), | 29 » » authcli.SubcommandInfo(auth.Options{}, "whoami", false), |
| 30 » » authcli.SubcommandLogin(auth.Options{}, "login"), | 30 » » authcli.SubcommandLogin(auth.Options{}, "login", false), |
| 31 » » authcli.SubcommandLogout(auth.Options{}, "logout"), | 31 » » authcli.SubcommandLogout(auth.Options{}, "logout", false), |
| 32 common.CmdVersion(version), | 32 common.CmdVersion(version), |
| 33 }, | 33 }, |
| 34 } | 34 } |
| 35 | 35 |
| 36 func main() { | 36 func main() { |
| 37 log.SetFlags(log.Lmicroseconds) | 37 log.SetFlags(log.Lmicroseconds) |
| 38 os.Exit(subcommands.Run(application, nil)) | 38 os.Exit(subcommands.Run(application, nil)) |
| 39 } | 39 } |
| OLD | NEW |