cmd

package
v2.18.1 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2022 License: MIT Imports: 67 Imported by: 0

Documentation

Overview

Package cmd contains chezmoi's commands.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Main

func Main(versionInfo VersionInfo, args []string) int

Main runs chezmoi and returns an exit code.

func StringOrBoolToAutoBoolHookFunc

func StringOrBoolToAutoBoolHookFunc() mapstructure.DecodeHookFunc

StringOrBoolToAutoBoolHookFunc is a github.com/mitchellh/mapstructure.DecodeHookFunc that parses an autoBool from a bool or string.

Types

type Config

type Config struct {
	ConfigFile
	// contains filtered or unexported fields
}

A Config represents a configuration.

func (*Config) Close added in v2.15.2

func (c *Config) Close() error

Close closes resources associated with c.

type ConfigFile added in v2.14.0

type ConfigFile struct {
	// Global configuration.
	CacheDirAbsPath    chezmoi.AbsPath                 `json:"cacheDir" mapstructure:"cacheDir"`
	Color              autoBool                        `mapstructure:"color"`
	Data               map[string]interface{}          `mapstructure:"data"`
	DestDirAbsPath     chezmoi.AbsPath                 `mapstructure:"destDir"`
	Interpreters       map[string]*chezmoi.Interpreter `mapstructure:"interpreters"`
	Mode               chezmoi.Mode                    `mapstructure:"mode"`
	Pager              string                          `mapstructure:"pager"`
	PINEntry           pinEntryConfig                  `mapstructure:"pinentry"`
	Safe               bool                            `mapstructure:"safe"`
	ScriptTempDir      chezmoi.AbsPath                 `mapstructure:"scriptTempDir"`
	SourceDirAbsPath   chezmoi.AbsPath                 `mapstructure:"sourceDir"`
	Template           templateConfig                  `mapstructure:"template"`
	TextConv           textConv                        `mapstructure:"textConv"`
	Umask              fs.FileMode                     `mapstructure:"umask"`
	UseBuiltinAge      autoBool                        `mapstructure:"useBuiltinAge"`
	UseBuiltinGit      autoBool                        `mapstructure:"useBuiltinGit"`
	Verbose            bool                            `mapstructure:"verbose"`
	WorkingTreeAbsPath chezmoi.AbsPath                 `mapstructure:"workingTree"`

	// Password manager configurations.
	Bitwarden   bitwardenConfig   `mapstructure:"bitwarden"`
	Gopass      gopassConfig      `mapstructure:"gopass"`
	Keepassxc   keepassxcConfig   `mapstructure:"keepassxc"`
	Keeper      keeperConfig      `mapstructure:"keeper"`
	Lastpass    lastpassConfig    `mapstructure:"lastpass"`
	Onepassword onepasswordConfig `mapstructure:"onepassword"`
	Pass        passConfig        `mapstructure:"pass"`
	Secret      secretConfig      `mapstructure:"secret"`
	Vault       vaultConfig       `mapstructure:"vault"`

	// Encryption configurations.
	Encryption string                `json:"encryption" mapstructure:"encryption"`
	Age        chezmoi.AgeEncryption `json:"age" mapstructure:"age"`
	GPG        chezmoi.GPGEncryption `json:"gpg" mapstructure:"gpg"`

	// Command configurations.
	Add        addCmdConfig        `mapstructure:"add"`
	CD         cdCmdConfig         `mapstructure:"cd"`
	Completion completionCmdConfig `mapstructure:"completion"`
	Diff       diffCmdConfig       `mapstructure:"diff"`
	Edit       editCmdConfig       `mapstructure:"edit"`
	Git        gitCmdConfig        `mapstructure:"git"`
	Merge      mergeCmdConfig      `mapstructure:"merge"`
	Status     statusCmdConfig     `mapstructure:"status"`
	Verify     verifyCmdConfig     `mapstructure:"verify"`
}

ConfigFile contains all data settable in the config file.

type VersionInfo

type VersionInfo struct {
	Version string
	Commit  string
	Date    string
	BuiltBy string
}

A VersionInfo contains a version.

func (VersionInfo) MarshalZerologObject

func (v VersionInfo) MarshalZerologObject(e *zerolog.Event)

MarshalZerologObject implements github.com/rs/zerolog.LogObjectMarshaler.MarshalZerologObject.

Jump to

Keyboard shortcuts

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