Skip to content

Commit

Permalink
feat: mise format
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Dec 11, 2024
1 parent e429a6e commit d18b040
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/.vitepress/cli_commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export const commands: { [key: string]: Command } = {
exec: {
hide: false,
},
format: {
fmt: {
hide: false,
},
generate: {
Expand Down
16 changes: 16 additions & 0 deletions docs/cli/fmt.md
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion docs/cli/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Answer yes to all confirmation prompts
- [`mise en [-s --shell <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 <SUBCOMMAND>`](/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)
Expand Down
2 changes: 1 addition & 1 deletion man/man1/mise.1
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion mise.usage.kdl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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(),
Expand Down
2 changes: 1 addition & 1 deletion xtasks/fig/src/mise.ts
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,7 @@ const completionSpec: Fig.Spec = {
},
{
"name": [
"format"
"fmt"
],
"description": "Formats mise.toml",
"options": [
Expand Down

0 comments on commit d18b040

Please sign in to comment.