Documentation
¶
Overview ¶
Package init provides the project initialization subcommand.
Index ¶
- func GitProtocolCompletions() []cobra.Completion
- func GitProtocolNames() []string
- func IsValidGitProtocol(s string) bool
- func IsValidVCSProvider(s string) bool
- func NewCmdProjectInit(f *cmdutil.Factory, runF func(context.Context, *ProjectInitOptions) error) *cobra.Command
- func PresetCompletions() []cobra.Completion
- func Run(ctx context.Context, opts *ProjectInitOptions) error
- func VCSCompletions() []cobra.Completion
- func VCSProviderNames() []string
- type ProjectInitOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GitProtocolCompletions ¶ added in v0.6.0
func GitProtocolCompletions() []cobra.Completion
GitProtocolCompletions returns cobra completions for the --git-protocol flag.
func GitProtocolNames ¶ added in v0.6.0
func GitProtocolNames() []string
GitProtocolNames returns valid protocol names for error messages.
func IsValidGitProtocol ¶ added in v0.6.0
IsValidGitProtocol checks if a string is a valid --git-protocol value.
func IsValidVCSProvider ¶ added in v0.6.0
IsValidVCSProvider checks if a string is a valid --vcs value.
func NewCmdProjectInit ¶
func NewCmdProjectInit(f *cmdutil.Factory, runF func(context.Context, *ProjectInitOptions) error) *cobra.Command
NewCmdProjectInit creates the project init command.
func PresetCompletions ¶ added in v0.6.0
func PresetCompletions() []cobra.Completion
PresetCompletions builds cobra.Completion values from config.Presets() for shell completion of the --preset flag.
func Run ¶ added in v0.2.0
func Run(ctx context.Context, opts *ProjectInitOptions) error
Run executes the project init command logic.
func VCSCompletions ¶ added in v0.6.0
func VCSCompletions() []cobra.Completion
VCSCompletions returns cobra completions for the --vcs flag.
func VCSProviderNames ¶ added in v0.6.0
func VCSProviderNames() []string
VCSProviderNames returns valid provider names for error messages.
Types ¶
type ProjectInitOptions ¶
type ProjectInitOptions struct {
IOStreams *iostreams.IOStreams
TUI *tui.TUI
Config func() (config.Config, error)
Logger func() (*logger.Logger, error)
ProjectManager func() (project.ProjectManager, error)
Name string // Positional arg: project name
Preset string // --preset flag: select a preset by name
VCS string // --vcs flag: github|gitlab|bitbucket
GitProtocol string // --git-protocol flag: https|ssh
NoGPG bool // --no-gpg flag: disable GPG forwarding
Force bool
Yes bool // Non-interactive mode
}
ProjectInitOptions contains the options for the project init command.