...

Source file src/edge-infra.dev/pkg/lib/cli/commands/version.go

Documentation: edge-infra.dev/pkg/lib/cli/commands

     1  package commands
     2  
     3  import (
     4  	"context"
     5  	"os"
     6  
     7  	"github.com/peterbourgon/ff/v3/ffcli"
     8  
     9  	"edge-infra.dev/pkg/lib/cli"
    10  	"edge-infra.dev/pkg/lib/runtime/version"
    11  )
    12  
    13  // Subcommand returns an ffcli compatible Command that can be
    14  // registered as a Subcommand on CLIs
    15  func Version() *ffcli.Command {
    16  	h := "Print version information"
    17  	cmd := &ffcli.Command{
    18  		Name:      "version",
    19  		ShortHelp: h,
    20  		LongHelp:  h,
    21  		Exec: func(_ context.Context, _ []string) error {
    22  			cli.Version(os.Stdout, version.New())
    23  			return nil
    24  		},
    25  	}
    26  	return cmd
    27  }
    28  

View as plain text