OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 /* | 5 /* |
6 CLI wrapper for infra/libs/auth library. Can be used to manage cached | 6 CLI wrapper for infra/libs/auth library. Can be used to manage cached |
7 credentials. | 7 credentials. |
8 */ | 8 */ |
9 package main | 9 package main |
10 | 10 |
11 import ( | 11 import ( |
12 "os" | 12 "os" |
13 | 13 |
| 14 "github.com/luci/luci-go/common/auth" |
| 15 "github.com/luci/luci-go/common/logging/gologger" |
| 16 |
14 "github.com/maruel/subcommands" | 17 "github.com/maruel/subcommands" |
15 | |
16 "infra/libs/auth" | |
17 "infra/libs/logging/gologger" | |
18 ) | 18 ) |
19 | 19 |
20 func main() { | 20 func main() { |
21 opts := auth.Options{Logger: gologger.Get()} | 21 opts := auth.Options{Logger: gologger.Get()} |
22 application := &subcommands.DefaultApplication{ | 22 application := &subcommands.DefaultApplication{ |
23 Name: "auth", | 23 Name: "auth", |
24 Title: "Chrome Infra Authentication tool", | 24 Title: "Chrome Infra Authentication tool", |
25 Commands: []*subcommands.Command{ | 25 Commands: []*subcommands.Command{ |
26 subcommands.CmdHelp, | 26 subcommands.CmdHelp, |
27 auth.SubcommandInfo(opts, "info"), | 27 auth.SubcommandInfo(opts, "info"), |
28 auth.SubcommandLogin(opts, "login"), | 28 auth.SubcommandLogin(opts, "login"), |
29 auth.SubcommandLogout(opts, "logout"), | 29 auth.SubcommandLogout(opts, "logout"), |
30 }, | 30 }, |
31 } | 31 } |
32 os.Exit(subcommands.Run(application, nil)) | 32 os.Exit(subcommands.Run(application, nil)) |
33 } | 33 } |
OLD | NEW |