blob: 5cac361327e9da0bcdd8ca69e6d0108c4ec6ad81 [file] [log] [blame]
// Copyright 2021 The Fuchsia Authors.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// The size_diff tool takes two binary_sizes objects and computes their diff.
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/client/versioncli"
"go.chromium.org/luci/hardcoded/chromeinfra"
)
const version = "0.1.0"
func getApplication(defaultAuthOpts auth.Options) *subcommands.DefaultApplication {
defaultAuthOpts.Scopes = []string{auth.OAuthScopeEmail}
return &subcommands.DefaultApplication{
Name: "size_diff",
Title: "Tool to compute binary size diffs.",
Commands: []*subcommands.Command{
cmdCI(defaultAuthOpts),
cmdManifest(defaultAuthOpts),
authcli.SubcommandInfo(defaultAuthOpts, "whoami", false),
authcli.SubcommandLogin(defaultAuthOpts, "login", false),
authcli.SubcommandLogout(defaultAuthOpts, "logout", false),
versioncli.CmdVersion(version),
subcommands.CmdHelp,
},
}
}
func main() {
log.SetFlags(log.Lmicroseconds)
app := getApplication(chromeinfra.DefaultAuthOptions())
os.Exit(subcommands.Run(app, nil))
}