...

Source file src/edge-infra.dev/pkg/tools/ci-billing/ci-billing-cli.go

Documentation: edge-infra.dev/pkg/tools/ci-billing

     1  package cibilling
     2  
     3  import (
     4  	"context"
     5  	"flag"
     6  	"os"
     7  
     8  	"github.com/peterbourgon/ff/v3/ffcli"
     9  
    10  	"edge-infra.dev/pkg/tools/ci-billing/commands/applylabels"
    11  	"edge-infra.dev/pkg/tools/ci-billing/commands/billingrefs"
    12  	"edge-infra.dev/pkg/tools/ci-billing/commands/owners"
    13  )
    14  
    15  func Run() error {
    16  	rootFlagSet := flag.NewFlagSet("root", flag.ContinueOnError)
    17  
    18  	root := &ffcli.Command{
    19  		Name:       "billingcli",
    20  		ShortUsage: "billingcli <subcommand>",
    21  		Subcommands: []*ffcli.Command{
    22  			owners.NewCmd(),
    23  			billingrefs.NewCmd(),
    24  			applylabels.NewCmd(),
    25  		},
    26  		FlagSet: rootFlagSet,
    27  		Exec: func(context.Context, []string) error {
    28  			return flag.ErrHelp
    29  		},
    30  	}
    31  
    32  	return root.ParseAndRun(context.Background(), os.Args[1:])
    33  }
    34  

View as plain text