diff --git a/docs/.vitepress/cli_commands.ts b/docs/.vitepress/cli_commands.ts index 0cba2f3123..2b0b257331 100644 --- a/docs/.vitepress/cli_commands.ts +++ b/docs/.vitepress/cli_commands.ts @@ -105,7 +105,7 @@ export const commands: { [key: string]: Command } = { exec: { hide: false, }, - format: { + fmt: { hide: false, }, generate: { diff --git a/docs/cli/fmt.md b/docs/cli/fmt.md new file mode 100644 index 0000000000..19cd6c4068 --- /dev/null +++ b/docs/cli/fmt.md @@ -0,0 +1,16 @@ +# `mise fmt` + +- **Usage**: `mise fmt [-a --all]` +- **Source code**: [`src/cli/fmt.rs`](https://github.com/jdx/mise/blob/main/src/cli/fmt.rs) + +Formats mise.toml + +## Flags + +### `-a --all` + +Format all files from the current directory + +Examples: + + mise format diff --git a/docs/cli/index.md b/docs/cli/index.md index 3328ff5014..03a52e4d49 100644 --- a/docs/cli/index.md +++ b/docs/cli/index.md @@ -67,7 +67,7 @@ Answer yes to all confirmation prompts - [`mise en [-s --shell ] [DIR]`](/cli/en.md) - [`mise env [FLAGS] [TOOL@VERSION]...`](/cli/env.md) - [`mise exec [FLAGS] [TOOL@VERSION]... [COMMAND]...`](/cli/exec.md) -- [`mise format [-a --all]`](/cli/format.md) +- [`mise fmt [-a --all]`](/cli/fmt.md) - [`mise generate `](/cli/generate.md) - [`mise generate git-pre-commit [FLAGS]`](/cli/generate/git-pre-commit.md) - [`mise generate github-action [FLAGS]`](/cli/generate/github-action.md) diff --git a/man/man1/mise.1 b/man/man1/mise.1 index 63b9ac792e..9012269c72 100644 --- a/man/man1/mise.1 +++ b/man/man1/mise.1 @@ -86,7 +86,7 @@ Exports env vars to activate mise a single time mise\-exec(1) Execute a command with tool(s) set .TP -mise\-format(1) +mise\-fmt(1) Formats mise.toml .TP mise\-generate(1) diff --git a/mise.usage.kdl b/mise.usage.kdl index 9f8af59015..a9d77545f0 100644 --- a/mise.usage.kdl +++ b/mise.usage.kdl @@ -424,7 +424,7 @@ The "--" separates runtimes from the commands to pass along to the subprocess."# arg "[TOOL@VERSION]..." help="Tool(s) to start e.g.: node@20 python@3.10" var=true arg "[COMMAND]..." help="Command string to execute (same as --command)" var=true } -cmd "format" help="Formats mise.toml" { +cmd "fmt" help="Formats mise.toml" { after_long_help r"Examples: $ mise format diff --git a/src/cli/mod.rs b/src/cli/mod.rs index 2ed7258c52..52665f8617 100644 --- a/src/cli/mod.rs +++ b/src/cli/mod.rs @@ -168,7 +168,7 @@ pub enum Commands { En(en::En), Env(env::Env), Exec(exec::Exec), - Format(fmt::Fmt), + Fmt(fmt::Fmt), Generate(generate::Generate), Global(global::Global), HookEnv(hook_env::HookEnv), @@ -230,7 +230,7 @@ impl Commands { Self::En(cmd) => cmd.run(), Self::Env(cmd) => cmd.run(), Self::Exec(cmd) => cmd.run(), - Self::Format(cmd) => cmd.run(), + Self::Fmt(cmd) => cmd.run(), Self::Generate(cmd) => cmd.run(), Self::Global(cmd) => cmd.run(), Self::HookEnv(cmd) => cmd.run(), diff --git a/xtasks/fig/src/mise.ts b/xtasks/fig/src/mise.ts index 5b683eb831..1ab89b6c4e 100644 --- a/xtasks/fig/src/mise.ts +++ b/xtasks/fig/src/mise.ts @@ -980,7 +980,7 @@ const completionSpec: Fig.Spec = { }, { "name": [ - "format" + "fmt" ], "description": "Formats mise.toml", "options": [