Skip to content

Commit 4d07521

Browse files
committed
fix: -f short flag for specifying formatters
Preserves backwards compatibility with v1 Signed-off-by: Brian McGee <[email protected]>
1 parent 54d3cd0 commit 4d07521

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

cli/cli.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type Format struct {
1515
ClearCache bool `short:"c" help:"Reset the evaluation cache. Use in case the cache is not precise enough."`
1616
ConfigFile string `type:"existingfile" default:"./treefmt.toml" help:"The config file to use."`
1717
FailOnChange bool `help:"Exit with error if any changes were made. Useful for CI."`
18-
Formatters []string `help:"Specify formatters to apply. Defaults to all formatters."`
18+
Formatters []string `short:"f" help:"Specify formatters to apply. Defaults to all formatters."`
1919
TreeRoot string `type:"existingdir" default:"." help:"The root directory from which treefmt will start walking the filesystem."`
2020
Walk walk.Type `enum:"auto,git,filesystem" default:"auto" help:"The method used to traverse the files within --tree-root. Currently supports 'auto', 'git' or 'filesystem'."`
2121
Verbosity int `name:"verbose" short:"v" type:"counter" default:"0" env:"LOG_LEVEL" help:"Set the verbosity of logs e.g. -vv."`

cli/format_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ func TestSpecifyingFormatters(t *testing.T) {
106106
assertStats(t, as, 31, 31, 2, 2)
107107

108108
setup()
109-
_, err = cmd(t, "-c", "--config-file", configPath, "--tree-root", tempDir, "--formatters", "ruby,nix")
109+
_, err = cmd(t, "-c", "--config-file", configPath, "--tree-root", tempDir, "-f", "ruby,nix")
110110
as.NoError(err)
111111
assertStats(t, as, 31, 31, 2, 2)
112112

0 commit comments

Comments
 (0)