cli_parsing

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfirmation

func GetConfirmation(prompt string) bool

func PrintCLIOpts

func PrintCLIOpts(config *Config)

Types

type CLI

type CLI struct {
	SourceDir        string   `` /* 168-byte string literal not displayed */
	TargetDir        string   `` /* 170-byte string literal not displayed */
	Mappings         []string `` /* 394-byte string literal not displayed */
	Renames          []string `` /* 347-byte string literal not displayed */
	CopyInclude      []string `` /* 690-byte string literal not displayed */
	CopyExclude      []string `` /* 484-byte string literal not displayed */
	ExplodeDirs      []string `` /* 439-byte string literal not displayed */
	FileRewrites     []string `` /* 494-byte string literal not displayed */
	RewritesAreRegex bool     `` /* 136-byte string literal not displayed */
	CleanTarget      bool     `help:"delete all files in the destination platform folder before copying ROMs in" optional:"" name:"cleanTarget"`
	SkipConfirm      bool     `help:"skip all confirmations and execute the copy process" optional:"" name:"skipConfirm"`
	DryRun           bool     `help:"don't execute any file copies or operations; just print what would be done" optional:"" name:"dryRun"`
	LoopbackCopy     bool     `` /* 426-byte string literal not displayed */
	SkipSummary      bool     `help:"[EXPERIMENTAL/UNSAFE] do not display a summary of operations to be performed" optional:"" name:"skipSummary"`
}

type Config

type Config struct {
	SourceDir        string
	TargetDir        string
	Mappings         []DirMapping
	Renames          []NameMapping
	CopyInclude      []string
	CopyExclude      []string
	ExplodeDirs      []string
	FileRewrites     []RewriteRule
	RewritesAreRegex bool
	CleanTarget      bool
	SkipConfirm      bool
	DryRun           bool
	LoopbackCopy     bool
	SkipSummary      bool
}

func ParseAndValidate

func ParseAndValidate() (*Config, error)

func (*Config) Validate added in v0.0.2

func (c *Config) Validate() error

type DirMapping

type DirMapping struct {
	Source      string
	Destination string
}

type NameMapping

type NameMapping struct {
	OldName string
	NewName string
}

type RewriteRule

type RewriteRule struct {
	FileGlob       string
	SearchPattern  string
	ReplacePattern string
}

Jump to

Keyboard shortcuts

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