blob: a3ff2e2a33a3b485378ed2fc211bec4b479b3e3a [file] [log] [blame]
// Copyright 2022 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package main
import (
"log"
"os"
"github.com/maruel/subcommands"
"go.chromium.org/luci/auth"
"go.chromium.org/luci/auth/client/authcli"
"go.chromium.org/luci/hardcoded/chromeinfra"
)
func getApplication(defaultAuthOpts auth.Options) *subcommands.DefaultApplication {
defaultAuthOpts.Scopes = []string{
"https://www.googleapis.com/auth/bigquery",
"https://www.googleapis.com/auth/userinfo.email",
}
return &subcommands.DefaultApplication{
Name: "builder_oracle",
Title: "Tool for estimating the impact of builder config changes.",
Commands: []*subcommands.Command{
cmdSimulate(defaultAuthOpts),
authcli.SubcommandInfo(defaultAuthOpts, "whoami", false),
authcli.SubcommandLogin(defaultAuthOpts, "login", false),
authcli.SubcommandLogout(defaultAuthOpts, "logout", false),
subcommands.CmdHelp,
},
}
}
func main() {
log.SetFlags(log.Lmicroseconds)
app := getApplication(chromeinfra.DefaultAuthOptions())
os.Exit(subcommands.Run(app, nil))
}