clifx

package module
v0.0.0-...-2c94a9b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 28, 2022 License: Apache-2.0 Imports: 6 Imported by: 8

README

clifx

Documentation

Overview

Copyright by LunaSec (owned by Refinery Labs, Inc)

Licensed under the Business Source License v1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

https://github.com/lunasec-io/lunasec/blob/master/licenses/BSL-LunaTrace.txt

See the License for the specific language governing permissions and limitations under the License.

Copyright by LunaSec (owned by Refinery Labs, Inc)

Licensed under the Business Source License v1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

https://github.com/lunasec-io/lunasec/blob/master/licenses/BSL-LunaTrace.txt

See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	RootCommandGroup = "cli_root_commands"
	RootFlagGroup    = "cli_root_flags"
)

Variables

This section is empty.

Functions

func Main

func Main(opts ...fx.Option)

func NewApp

func NewApp(in AppIn) *cli.App

Types

type AppConfig

type AppConfig struct {
	// The name of the program. Defaults to path.Base(os.Args[0])
	Name string
	// Full name of command for help, defaults to Name
	HelpName string
	// Description of the program.
	Usage string
	// Text to override the USAGE section of help
	UsageText string
	// Description of the program argument format.
	ArgsUsage string
	// Version of the program
	Version string
	// Description of the program
	Description string
	// An action to execute before any subcommands are run, but after the context is ready
	// If a non-nil error is returned, no subcommands are run
	Before cli.BeforeFunc
	// An action to execute after any subcommands are run, but after the subcommand has finished
	// It is run even if Action() panics
	After cli.AfterFunc
	// Execute this function if the proper command cannot be found
	CommandNotFound cli.CommandNotFoundFunc
	// Execute this function if a usage error occurs
	OnUsageError cli.OnUsageErrorFunc
}

type AppDeps

type AppDeps struct {
	fx.In
	// List of commands to execute
	Commands []*cli.Command `group:"cli_root_commands"`
	// List of flags to parse
	Flags  []cli.Flag     `group:"cli_root_flags"`
	Action cli.ActionFunc `optional:"true"`
}

type AppIn

type AppIn struct {
	fx.In
	AppConfig *AppConfig `optional:"true"`
	AppDeps   AppDeps
}

type CommandResult

type CommandResult struct {
	fx.Out
	Command *cli.Command `group:"cli_root_commands"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳