cmd

package
v2.29.0 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2023 License: MIT Imports: 82 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" yaml:"cacheDir"`
	Color              autoBool                        `json:"color" mapstructure:"color" yaml:"color"`
	Data               map[string]any                  `json:"data" mapstructure:"data" yaml:"data"`
	Format             writeDataFormat                 `json:"format" mapstructure:"format" yaml:"format"`
	DestDirAbsPath     chezmoi.AbsPath                 `json:"destDir" mapstructure:"destDir" yaml:"destDir"`
	Interpreters       map[string]*chezmoi.Interpreter `json:"interpreters" mapstructure:"interpreters" yaml:"interpreters"` //nolint:lll
	Mode               chezmoi.Mode                    `json:"mode" mapstructure:"mode" yaml:"mode"`
	Pager              string                          `json:"pager" mapstructure:"pager" yaml:"pager"`
	PINEntry           pinEntryConfig                  `json:"pinentry" mapstructure:"pinentry" yaml:"pinentry"`
	Progress           bool                            `json:"progress" mapstructure:"progress" yaml:"progress"`
	Safe               bool                            `json:"safe" mapstructure:"safe" yaml:"safe"`
	ScriptEnv          map[string]string               `json:"scriptEnv" mapstructure:"scriptEnv" yaml:"scriptEnv"`
	ScriptTempDir      chezmoi.AbsPath                 `json:"scriptTempDir" mapstructure:"scriptTempDir" yaml:"scriptTempDir"` //nolint:lll
	SourceDirAbsPath   chezmoi.AbsPath                 `json:"sourceDir" mapstructure:"sourceDir" yaml:"sourceDir"`
	Template           templateConfig                  `json:"template" mapstructure:"template" yaml:"template"`
	TextConv           textConv                        `json:"textConv" mapstructure:"textConv" yaml:"textConv"`
	Umask              fs.FileMode                     `json:"umask" mapstructure:"umask" yaml:"umask"`
	UseBuiltinAge      autoBool                        `json:"useBuiltinAge" mapstructure:"useBuiltinAge" yaml:"useBuiltinAge"` //nolint:lll
	UseBuiltinGit      autoBool                        `json:"useBuiltinGit" mapstructure:"useBuiltinGit" yaml:"useBuiltinGit"` //nolint:lll
	Verbose            bool                            `json:"verbose" mapstructure:"verbose" yaml:"verbose"`
	Warnings           warningsConfig                  `json:"warnings" mapstructure:"warnings" yaml:"warnings"`
	WorkingTreeAbsPath chezmoi.AbsPath                 `json:"workingTree" mapstructure:"workingTree" yaml:"workingTree"`

	// Password manager configurations.
	AWSSecretsManager awsSecretsManagerConfig `json:"awsSecretsManager" mapstructure:"awsSecretsManager" yaml:"awsSecretsManager"` //nolint:lll
	Bitwarden         bitwardenConfig         `json:"bitwarden" mapstructure:"bitwarden" yaml:"bitwarden"`
	Gopass            gopassConfig            `json:"gopass" mapstructure:"gopass" yaml:"gopass"`
	Keepassxc         keepassxcConfig         `json:"keepassxc" mapstructure:"keepassxc" yaml:"keepassxc"`
	Keeper            keeperConfig            `json:"keeper" mapstructure:"keeper" yaml:"keeper"`
	Lastpass          lastpassConfig          `json:"lastpass" mapstructure:"lastpass" yaml:"lastpass"`
	Onepassword       onepasswordConfig       `json:"onepassword" mapstructure:"onepassword" yaml:"onepassword"`
	Pass              passConfig              `json:"pass" mapstructure:"pass" yaml:"pass"`
	Passhole          passholeConfig          `json:"passhole" mapstructure:"passhole" yaml:"passhole"`
	Secret            secretConfig            `json:"secret" mapstructure:"secret" yaml:"secret"`
	Vault             vaultConfig             `json:"vault" mapstructure:"vault" yaml:"vault"`

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

	// Command configurations.
	Add        addCmdConfig        `json:"add" mapstructure:"add" yaml:"add"`
	CD         cdCmdConfig         `json:"cd" mapstructure:"cd" yaml:"cd"`
	Completion completionCmdConfig `json:"completion" mapstructure:"completion" yaml:"completion"`
	Diff       diffCmdConfig       `json:"diff" mapstructure:"diff" yaml:"diff"`
	Edit       editCmdConfig       `json:"edit" mapstructure:"edit" yaml:"edit"`
	Git        gitCmdConfig        `json:"git" mapstructure:"git" yaml:"git"`
	Merge      mergeCmdConfig      `json:"merge" mapstructure:"merge" yaml:"merge"`
	Status     statusCmdConfig     `json:"status" mapstructure:"status" yaml:"status"`
	Update     updateCmdConfig     `json:"update" mapstructure:"update" yaml:"update"`
	Verify     verifyCmdConfig     `json:"verify" mapstructure:"verify" yaml:"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