blob: 6fcc2c42f5c1f6915e85e522c00ed239f4c2a9bb [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 (
"github.com/maruel/subcommands"
"go.chromium.org/luci/auth"
"go.chromium.org/luci/auth/client/authcli"
)
type commonFlags struct {
subcommands.CommandRunBase
authFlags authcli.Flags
parsedAuthOpts auth.Options
}
func (c *commonFlags) Init(authOpts auth.Options) {
c.authFlags.Register(&c.Flags, authOpts)
}
func (c *commonFlags) Parse() error {
var err error
c.parsedAuthOpts, err = c.authFlags.Options()
if err != nil {
return err
}
return nil
}