...

Source file src/edge-infra.dev/hack/tools/apko-updater-bot/cmd/apko-updater-bot.go

Documentation: edge-infra.dev/hack/tools/apko-updater-bot/cmd

     1  package cmd
     2  
     3  import (
     4  	"context"
     5  	"fmt"
     6  	"os"
     7  
     8  	"edge-infra.dev/hack/tools/apko-updater-bot/cmd/update"
     9  	"edge-infra.dev/pkg/lib/cli/sink"
    10  )
    11  
    12  func New() (*sink.Command, error) {
    13  	cmd := &sink.Command{
    14  		Use:   "apko-updater-bot [command]",
    15  		Short: "CLI for updating rules_apko entities",
    16  		Commands: []*sink.Command{
    17  			update.New(),
    18  		},
    19  	}
    20  
    21  	return cmd, nil
    22  }
    23  
    24  func Run(ctx context.Context) error {
    25  	c, err := New()
    26  	if err != nil {
    27  		fmt.Println("error: failed to instantiate CLI:", err)
    28  		return err
    29  	}
    30  
    31  	return c.ParseAndRun(ctx, os.Args[1:])
    32  }
    33  

View as plain text