cmd

package
v2.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2021 License: MIT Imports: 58 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 {
	// Global configuration, settable in the config file.
	SourceDirAbsPath chezmoi.AbsPath                 `mapstructure:"sourceDir"`
	DestDirAbsPath   chezmoi.AbsPath                 `mapstructure:"destDir"`
	Umask            fs.FileMode                     `mapstructure:"umask"`
	Remove           bool                            `mapstructure:"remove"`
	Color            *autoBool                       `mapstructure:"color"`
	Data             map[string]interface{}          `mapstructure:"data"`
	Template         templateConfig                  `mapstructure:"template"`
	UseBuiltinGit    *autoBool                       `mapstructure:"useBuiltinGit"`
	Pager            string                          `mapstructure:"pager"`
	Interpreters     map[string]*chezmoi.Interpreter `mapstructure:"interpreters"`

	// Password manager configurations, settable in the config file.
	Bitwarden   bitwardenConfig   `mapstructure:"bitwarden"`
	Gopass      gopassConfig      `mapstructure:"gopass"`
	Keepassxc   keepassxcConfig   `mapstructure:"keepassxc"`
	Lastpass    lastpassConfig    `mapstructure:"lastpass"`
	Onepassword onepasswordConfig `mapstructure:"onepassword"`
	Pass        passConfig        `mapstructure:"pass"`
	Secret      secretConfig      `mapstructure:"secret"`
	Vault       vaultConfig       `mapstructure:"vault"`

	// Encryption configurations, settable in the config file.
	Encryption string                `mapstructure:"encryption"`
	AGE        chezmoi.AGEEncryption `mapstructure:"age"`
	GPG        chezmoi.GPGEncryption `mapstructure:"gpg"`

	// Command configurations, settable in the config file.
	Add   addCmdConfig   `mapstructure:"add"`
	CD    cdCmdConfig    `mapstructure:"cd"`
	Diff  diffCmdConfig  `mapstructure:"diff"`
	Docs  docsCmdConfig  `mapstructure:"docs"`
	Edit  editCmdConfig  `mapstructure:"edit"`
	Git   gitCmdConfig   `mapstructure:"git"`
	Merge mergeCmdConfig `mapstructure:"merge"`
	// contains filtered or unexported fields
}

A Config represents a configuration.

type ErrExitCode

type ErrExitCode int

An ErrExitCode indicates the the main program should exit with the given code.

func (ErrExitCode) Error

func (e ErrExitCode) Error() string

type VersionInfo

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

A VersionInfo contains a version.

Jump to

Keyboard shortcuts

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