options

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2025 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GlobalOpts = GlobalOptions{
	Verbosity:  0,
	Quiet:      false,
	Accessible: false,
}

The global options for the CLI

View Source
var NewOpts = NewOptions{
	Repo:        *types.NewValueGuard("", cmdOpt, types.REPO),
	Source:      *types.NewValueGuard("", cmdOpt, types.REPO),
	Branch:      *types.NewValueGuard("", cmdOpt, types.BRANCH),
	Directory:   *types.NewValueGuard("", cmdOpt, types.PATH),
	Name:        *types.NewValueGuard("", cmdOpt, types.STRING),
	License:     *types.NewValueGuard("", cmdOpt, types.STRING),
	Style:       *types.NewValueGuard("", cmdOpt, types.STRING),
	NoGit:       false,
	NoLicense:   false,
	AllowSpaces: false,
}

The options for the new command

Functions

This section is empty.

Types

type GlobalOptions

type GlobalOptions struct {
	// The verbosity level of the CLI
	// The larger, the more verbose
	Verbosity int

	// Silence output
	Quiet bool

	// Mainly for screen-reader support, dropping
	// TUIs in favor of traditional prompts
	Accessible bool
}

type NewOptions

type NewOptions struct {
	// The repository Url to use
	// Should be this repository by default
	Repo types.ValueGuard[string]

	// The repository Url or local path to use
	// Should be this repository by default
	Source types.ValueGuard[string]

	// The branch to use
	Branch types.ValueGuard[string]

	// The directory of the template to use
	Directory types.ValueGuard[string]

	// The name of your project
	Name types.ValueGuard[string]

	// The license of your project
	License types.ValueGuard[string]

	// The style to use
	Style types.ValueGuard[string]

	// Whether to skip initializing git
	NoGit bool

	// Whether to skip initializing license
	NoLicense bool

	// Whether to allow spaces in the project name
	// This will skip replacing them with hyphens
	AllowSpaces bool
}

func (*NewOptions) CloneRepo

func (o *NewOptions) CloneRepo() (string, error)

To clone the repository

func (*NewOptions) GetSource added in v0.7.0

func (o *NewOptions) GetSource() (string, error)

GetSource returns the source directory path that is either cloned with Git or is local.

If it is a Git cloned path, it will be cleaned

func (*NewOptions) Validate

func (o *NewOptions) Validate() error

TO be invoked before a command is ran

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL