You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: cli/cli.go
+1-1
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,7 @@ type Format struct {
23
23
ConfigFilestring`type:"existingfile" help:"Load the config file from the given path (defaults to searching upwards for treefmt.toml)."`
24
24
FailOnChangebool`help:"Exit with error if any changes were made. Useful for CI."`
25
25
Formatters []string`short:"f" help:"Specify formatters to apply. Defaults to all formatters."`
26
-
TreeRootstring`type:"existingdir" xor:"tree-root" help:"The root directory from which treefmt will start walking the filesystem (defaults to the directory containing the config file)."`
26
+
TreeRootstring`type:"existingdir" xor:"tree-root" env:"PRJ_ROOT" help:"The root directory from which treefmt will start walking the filesystem (defaults to the directory containing the config file)."`
27
27
TreeRootFilestring`type:"string" xor:"tree-root" help:"File to search for to find the project root (if --tree-root is not passed)."`
28
28
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'."`
29
29
Verbosityint`name:"verbose" short:"v" type:"counter" default:"0" env:"LOG_LEVEL" help:"Set the verbosity of logs e.g. -vv."`
Copy file name to clipboardexpand all lines: docs/usage.md
+18-16
Original file line number
Diff line number
Diff line change
@@ -13,22 +13,24 @@ Arguments:
13
13
[<paths> ...] Paths to format. Defaults to formatting the whole tree.
14
14
15
15
Flags:
16
-
-h, --help Show context-sensitive help.
17
-
--allow-missing-formatter Do not exit with error if a configured formatter is missing.
18
-
-C, --working-directory="." Run as if treefmt was started in the specified working directory instead of the current working directory.
19
-
--no-cache Ignore the evaluation cache entirely. Useful for CI.
20
-
-c, --clear-cache Reset the evaluation cache. Use in case the cache is not precise enough.
21
-
--config-file="./treefmt.toml" The config file to use.
22
-
--fail-on-change Exit with error if any changes were made. Useful for CI.
23
-
--formatters=FORMATTERS,... Specify formatters to apply. Defaults to all formatters.
24
-
--tree-root="." The root directory from which treefmt will start walking the filesystem.
25
-
--walk="auto" The method used to traverse the files within --tree-root. Currently supports 'auto', 'git' or 'filesystem'.
26
-
-v, --verbose Set the verbosity of logs e.g. -vv ($LOG_LEVEL).
27
-
-V, --version Print version.
28
-
-i, --init Create a new treefmt.toml.
29
-
-u, --on-unmatched=warn Log paths that did not match any formatters at the specified log level, with fatal exiting the process with an error. Possible values are <debug|info|warn|error|fatal>.
30
-
--stdin Format the context passed in via stdin.
31
-
--cpu-profile=STRING The file into which a cpu profile will be written.
16
+
-h, --help Show context-sensitive help.
17
+
--allow-missing-formatter Do not exit with error if a configured formatter is missing.
18
+
-C, --working-directory="." Run as if treefmt was started in the specified working directory instead of the current working directory.
19
+
--no-cache Ignore the evaluation cache entirely. Useful for CI.
20
+
-c, --clear-cache Reset the evaluation cache. Use in case the cache is not precise enough.
21
+
--config-file=STRING Load the config file from the given path (defaults to searching upwards for treefmt.toml).
22
+
--fail-on-change Exit with error if any changes were made. Useful for CI.
23
+
-f, --formatters=FORMATTERS,... Specify formatters to apply. Defaults to all formatters.
24
+
--tree-root=STRING The root directory from which treefmt will start walking the filesystem (defaults to the directory containing the config file) ($PRJ_ROOT).
25
+
--tree-root-file=STRING File to search for to find the project root (if --tree-root is not passed).
26
+
--walk="auto" The method used to traverse the files within --tree-root. Currently supports 'auto', 'git' or 'filesystem'.
27
+
-v, --verbose Set the verbosity of logs e.g. -vv ($LOG_LEVEL).
28
+
-V, --version Print version.
29
+
-i, --init Create a new treefmt.toml.
30
+
-u, --on-unmatched=warn Log paths that did not match any formatters at the specified log level, with fatal exiting the process with an error. Possible values are
31
+
<debug|info|warn|error|fatal>.
32
+
--stdin Format the context passed in via stdin.
33
+
--cpu-profile=STRING The file into which a cpu profile will be written.
0 commit comments