Navigation Menu

Skip to content

Commit

Permalink
Remove trailing E from function names
Browse files Browse the repository at this point in the history
  • Loading branch information
twpayne committed Dec 2, 2018
1 parent 12ce5b9 commit c37b9ad
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions cmd/add.go
Expand Up @@ -13,7 +13,7 @@ var addCommand = &cobra.Command{
Use: "add",
Args: cobra.MinimumNArgs(1),
Short: "Add an existing file or directory",
RunE: makeRunE(config.runAddCommandE),
RunE: makeRunE(config.runAddCommand),
}

// An AddCommandConfig is a configuration for the add command.
Expand All @@ -32,7 +32,7 @@ func init() {
persistentFlags.BoolVarP(&config.add.template, "template", "T", false, "add files as templates")
}

func (c *Config) runAddCommandE(fs vfs.FS, command *cobra.Command, args []string) error {
func (c *Config) runAddCommand(fs vfs.FS, command *cobra.Command, args []string) error {
targetState, err := c.getTargetState(fs)
if err != nil {
return err
Expand Down
4 changes: 2 additions & 2 deletions cmd/add_test.go
Expand Up @@ -144,8 +144,8 @@ func TestAddCommand(t *testing.T) {
if err != nil {
t.Fatalf("vfst.NewTestFS(_) == _, _, %v, want _, _, <nil>", err)
}
if err := c.runAddCommandE(fs, nil, tc.args); err != nil {
t.Errorf("c.runAddCommandE(fs, nil, %+v) == %v, want <nil>", tc.args, err)
if err := c.runAddCommand(fs, nil, tc.args); err != nil {
t.Errorf("c.runAddCommand(fs, nil, %+v) == %v, want <nil>", tc.args, err)
}
vfst.RunTests(t, fs, "", tc.tests)
})
Expand Down
4 changes: 2 additions & 2 deletions cmd/apply.go
Expand Up @@ -8,14 +8,14 @@ import (
var applyCommand = &cobra.Command{
Use: "apply",
Short: "Update the actual state to match the target state",
RunE: makeRunE(config.runApplyCommandE),
RunE: makeRunE(config.runApplyCommand),
}

func init() {
rootCommand.AddCommand(applyCommand)
}

func (c *Config) runApplyCommandE(fs vfs.FS, command *cobra.Command, args []string) error {
func (c *Config) runApplyCommand(fs vfs.FS, command *cobra.Command, args []string) error {
actuator := c.getDefaultActuator(fs)
return c.applyArgs(fs, args, actuator)
}
4 changes: 2 additions & 2 deletions cmd/archive.go
Expand Up @@ -12,14 +12,14 @@ var archiveCommand = &cobra.Command{
Use: "archive",
Args: cobra.NoArgs,
Short: "Write a tar archive of the target state to stdout",
RunE: makeRunE(config.runArchiveCommandE),
RunE: makeRunE(config.runArchiveCommand),
}

func init() {
rootCommand.AddCommand(archiveCommand)
}

func (c *Config) runArchiveCommandE(fs vfs.FS, command *cobra.Command, args []string) error {
func (c *Config) runArchiveCommand(fs vfs.FS, command *cobra.Command, args []string) error {
targetState, err := c.getTargetState(fs)
if err != nil {
return err
Expand Down
4 changes: 2 additions & 2 deletions cmd/diff.go
Expand Up @@ -11,14 +11,14 @@ import (
var diffCommand = &cobra.Command{
Use: "diff",
Short: "Print the diff between the actual state and the target state",
RunE: makeRunE(config.runDiffCommandE),
RunE: makeRunE(config.runDiffCommand),
}

func init() {
rootCommand.AddCommand(diffCommand)
}

func (c *Config) runDiffCommandE(fs vfs.FS, command *cobra.Command, args []string) error {
func (c *Config) runDiffCommand(fs vfs.FS, command *cobra.Command, args []string) error {
actuator := chezmoi.NewLoggingActuator(os.Stdout, chezmoi.NewNullActuator())
return c.applyArgs(fs, args, actuator)
}
4 changes: 2 additions & 2 deletions cmd/dump.go
Expand Up @@ -12,14 +12,14 @@ import (
var dumpCommand = &cobra.Command{
Use: "dump",
Short: "Dump the target state",
RunE: makeRunE(config.runDumpCommandE),
RunE: makeRunE(config.runDumpCommand),
}

func init() {
rootCommand.AddCommand(dumpCommand)
}

func (c *Config) runDumpCommandE(fs vfs.FS, command *cobra.Command, args []string) error {
func (c *Config) runDumpCommand(fs vfs.FS, command *cobra.Command, args []string) error {
targetState, err := c.getTargetState(fs)
if err != nil {
return err
Expand Down
4 changes: 2 additions & 2 deletions cmd/edit.go
Expand Up @@ -16,7 +16,7 @@ var editCommand = &cobra.Command{
Use: "edit",
Args: cobra.MinimumNArgs(1),
Short: "Edit a file",
RunE: makeRunE(config.runEditCommandE),
RunE: makeRunE(config.runEditCommand),
}

type editCommandConfig struct {
Expand All @@ -34,7 +34,7 @@ func init() {
persistentFlags.BoolVarP(&config.edit.prompt, "prompt", "p", false, "prompt before applying (implies --diff)")
}

func (c *Config) runEditCommandE(fs vfs.FS, command *cobra.Command, args []string) error {
func (c *Config) runEditCommand(fs vfs.FS, command *cobra.Command, args []string) error {
if c.edit.prompt {
c.edit.diff = true
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/forget.go
Expand Up @@ -11,14 +11,14 @@ var forgetCommand = &cobra.Command{
Use: "forget",
Args: cobra.MinimumNArgs(1),
Short: "Forget a file or directory",
RunE: makeRunE(config.runForgetCommandE),
RunE: makeRunE(config.runForgetCommand),
}

func init() {
rootCommand.AddCommand(forgetCommand)
}

func (c *Config) runForgetCommandE(fs vfs.FS, command *cobra.Command, args []string) error {
func (c *Config) runForgetCommand(fs vfs.FS, command *cobra.Command, args []string) error {
targetState, err := c.getTargetState(fs)
if err != nil {
return err
Expand Down
4 changes: 2 additions & 2 deletions cmd/verify.go
Expand Up @@ -11,14 +11,14 @@ import (
var verifyCommand = &cobra.Command{
Use: "verify",
Short: "Exit with success if the actual state matches the target state, fail otherwise",
RunE: makeRunE(config.runVerifyCommandE),
RunE: makeRunE(config.runVerifyCommand),
}

func init() {
rootCommand.AddCommand(verifyCommand)
}

func (c *Config) runVerifyCommandE(fs vfs.FS, command *cobra.Command, args []string) error {
func (c *Config) runVerifyCommand(fs vfs.FS, command *cobra.Command, args []string) error {
actuator := chezmoi.NewAnyActuator(chezmoi.NewNullActuator())
if err := c.applyArgs(fs, args, actuator); err != nil {
return err
Expand Down
4 changes: 2 additions & 2 deletions cmd/version.go
Expand Up @@ -11,14 +11,14 @@ var versionCommand = &cobra.Command{
Use: "version",
Args: cobra.NoArgs,
Short: "Print version",
RunE: makeRunE(config.runVersionCommandE),
RunE: makeRunE(config.runVersionCommand),
}

func init() {
rootCommand.AddCommand(versionCommand)
}

func (c *Config) runVersionCommandE(fs vfs.FS, cmd *cobra.Command, args []string) error {
func (c *Config) runVersionCommand(fs vfs.FS, cmd *cobra.Command, args []string) error {
fmt.Printf("Version: %s Commit: %s Date: %s\n", c.version.Version, c.version.Commit, c.version.Date)
return nil
}

0 comments on commit c37b9ad

Please sign in to comment.