From cf18b70db38b2fde95cf489de63127fa13a53753 Mon Sep 17 00:00:00 2001 From: Jeff Dickey <216188+jdx@users.noreply.github.com> Date: Sun, 14 Jan 2024 02:02:37 -0600 Subject: [PATCH] wip --- cli/src/cli/generate/markdown.rs | 33 ++- examples/docs/MISE_INLINE.md | 278 +++++++----------- examples/docs/MISE_MULTI.md | 126 ++++---- examples/docs/cli-reference/activate.md | 3 +- examples/docs/cli-reference/alias.md | 3 +- examples/docs/cli-reference/alias/get.md | 3 +- examples/docs/cli-reference/alias/ls.md | 3 +- examples/docs/cli-reference/alias/set.md | 3 +- examples/docs/cli-reference/alias/unset.md | 3 +- examples/docs/cli-reference/bin-paths.md | 3 +- examples/docs/cli-reference/cache.md | 3 +- examples/docs/cli-reference/cache/clear.md | 3 +- examples/docs/cli-reference/completion.md | 3 +- examples/docs/cli-reference/config.md | 3 +- .../docs/cli-reference/config/generate.md | 3 +- examples/docs/cli-reference/config/ls.md | 3 +- examples/docs/cli-reference/current.md | 3 +- examples/docs/cli-reference/deactivate.md | 3 +- examples/docs/cli-reference/direnv.md | 3 +- .../docs/cli-reference/direnv/activate.md | 3 +- examples/docs/cli-reference/doctor.md | 3 +- examples/docs/cli-reference/env.md | 3 +- examples/docs/cli-reference/exec.md | 3 +- examples/docs/cli-reference/implode.md | 3 +- examples/docs/cli-reference/install.md | 3 +- examples/docs/cli-reference/latest.md | 3 +- examples/docs/cli-reference/link.md | 3 +- examples/docs/cli-reference/ls-remote.md | 3 +- examples/docs/cli-reference/ls.md | 3 +- examples/docs/cli-reference/outdated.md | 3 +- examples/docs/cli-reference/plugins.md | 3 +- .../docs/cli-reference/plugins/install.md | 3 +- examples/docs/cli-reference/plugins/link.md | 3 +- .../docs/cli-reference/plugins/ls-remote.md | 3 +- examples/docs/cli-reference/plugins/ls.md | 3 +- .../docs/cli-reference/plugins/uninstall.md | 3 +- examples/docs/cli-reference/plugins/update.md | 3 +- examples/docs/cli-reference/prune.md | 3 +- examples/docs/cli-reference/reshim.md | 3 +- examples/docs/cli-reference/run.md | 3 +- examples/docs/cli-reference/self-update.md | 3 +- examples/docs/cli-reference/set.md | 3 +- examples/docs/cli-reference/settings.md | 3 +- examples/docs/cli-reference/settings/get.md | 3 +- examples/docs/cli-reference/settings/ls.md | 3 +- examples/docs/cli-reference/settings/set.md | 3 +- examples/docs/cli-reference/settings/unset.md | 3 +- examples/docs/cli-reference/shell.md | 3 +- examples/docs/cli-reference/sync.md | 3 +- examples/docs/cli-reference/sync/node.md | 3 +- examples/docs/cli-reference/sync/python.md | 3 +- examples/docs/cli-reference/task.md | 3 +- examples/docs/cli-reference/task/deps.md | 3 +- examples/docs/cli-reference/task/edit.md | 3 +- examples/docs/cli-reference/task/ls.md | 3 +- examples/docs/cli-reference/task/run.md | 3 +- examples/docs/cli-reference/trust.md | 3 +- examples/docs/cli-reference/uninstall.md | 3 +- examples/docs/cli-reference/unset.md | 3 +- examples/docs/cli-reference/upgrade.md | 3 +- examples/docs/cli-reference/usage.md | 3 +- examples/docs/cli-reference/use.md | 3 +- examples/docs/cli-reference/version.md | 3 +- examples/docs/cli-reference/watch.md | 3 +- examples/docs/cli-reference/where.md | 3 +- examples/docs/cli-reference/which.md | 3 +- examples/mise.usage.kdl | 5 + src/parse/cmd.rs | 47 ++- src/parse/spec.rs | 10 +- 69 files changed, 306 insertions(+), 382 deletions(-) diff --git a/cli/src/cli/generate/markdown.rs b/cli/src/cli/generate/markdown.rs index 4c17ff9..2d25593 100644 --- a/cli/src/cli/generate/markdown.rs +++ b/cli/src/cli/generate/markdown.rs @@ -85,16 +85,20 @@ const COMMANDS_INDEX_TEMPLATE: &str = r#" ## CLI Command Reference {% for cmd in commands -%} -{% if multi -%} -* [`{{ cmd.full_cmd | join(sep=" ") }}`](./{{ cmd.full_cmd | join(sep="/") | slugify }}) +{% if multi_dir -%} +* [`{{ cmd.full_cmd | join(sep=" ") }}`]({{ multi_dir }}/{% for c in cmd.full_cmd %}{{ c | slugify }}{% if not loop.last %}/{% endif %}{% endfor %}.md) {% else -%} * [`{{ cmd.full_cmd | join(sep=" ") }}`](#{{ cmd.full_cmd | join(sep=" ") | slugify }}) {% endif -%} {% endfor -%} "#; -const COMMAND_TEMPLATE: &str = r#" -### `{{ cmd.full_cmd | join(sep=" ") }}` +const COMMAND_TEMPLATE: &str = r##" +{% if multi_dir -%} +{{ header }} `{{ bin }} {{ cmd.full_cmd | join(sep=" ") }}` +{% else -%} +{{ header }} `{{ cmd.full_cmd | join(sep=" ") }}` +{% endif -%} {% if cmd.before_long_help -%} {{ cmd.before_long_help }} @@ -107,14 +111,14 @@ const COMMAND_TEMPLATE: &str = r#" {% endif -%} {% if cmd.args -%} -#### Args +**Args:** {% for arg in cmd.args -%} * `{{ arg.usage }}` – {{ arg.long_help | default(value=arg.help) }} {% endfor -%} {% endif %} {% if cmd.flags -%} -#### Flags +**Flags:** {% for flag in cmd.flags -%} * `{{ flag.usage }}` – {{ flag.long_help | default(value=flag.help) }} @@ -132,7 +136,7 @@ const COMMAND_TEMPLATE: &str = r#" {% elif cmd.after_help -%} {{ cmd.after_help }} {% endif -%} -"#; +"##; #[derive(Debug, EnumIs)] #[strum(serialize_all = "snake_case")] @@ -409,11 +413,16 @@ impl MarkdownBuilder { let mut ctx = ctx.clone(); ctx.insert("cmd", &cmd); let output_file = match &multi_dir { - Some(multi_dir) => self - .root - .join(multi_dir) - .join(format!("{}.md", cmd.full_cmd.join("/"))), - None => self.inject.clone(), + Some(multi_dir) => { + ctx.insert("header", "#"); + self.root + .join(multi_dir) + .join(format!("{}.md", cmd.full_cmd.join("/"))) + } + None => { + ctx.insert("header", &"#".repeat(cmd.full_cmd.len() + 2)); + self.inject.clone() + } }; let out = outputs.entry(output_file).or_insert_with(Vec::new); out.push(render_template(COMMAND_TEMPLATE.trim_start(), &ctx)?); diff --git a/examples/docs/MISE_INLINE.md b/examples/docs/MISE_INLINE.md index 23c54bb..9353810 100644 --- a/examples/docs/MISE_INLINE.md +++ b/examples/docs/MISE_INLINE.md @@ -117,14 +117,14 @@ foooooooo * [`watch`](#watch) * [`where`](#where) * [`which`](#which) +* [`zzz`](#zzz) ### `activate` - -#### Args +**Args:** * `[SHELL_TYPE]` – Shell type to generate the script for -#### Flags +**Flags:** * `-s,--shell ` – Shell type to generate the script for * `--status` – Show "mise: @" message when changing directories @@ -155,18 +155,16 @@ Examples: ### `alias` - * Aliases: `a` -#### Flags +**Flags:** * `-p,--plugin ` – filter aliases by plugin * `--no-header` – Don't show table header Manage aliases -### `alias get` - -#### Args +#### `alias get` +**Args:** * `` – The plugin to show the alias for * `` – The alias to show @@ -179,14 +177,13 @@ Examples: 20.0.0 -### `alias ls` - +#### `alias ls` * Aliases: `list` -#### Args +**Args:** * `[PLUGIN]` – Show aliases for -#### Flags +**Flags:** * `--no-header` – Don't show table header List aliases @@ -202,10 +199,9 @@ Examples: node lts-hydrogen 20.0.0 -### `alias set` - +#### `alias set` * Aliases: `add`, `create` -#### Args +**Args:** * `` – The plugin to set the alias for * `` – The alias to set @@ -218,10 +214,9 @@ Examples: $ mise alias set node lts-hydrogen 18.0.0 -### `alias unset` - +#### `alias unset` * Aliases: `rm`, `remove`, `delete`, `del` -#### Args +**Args:** * `` – The plugin to remove the alias from * `` – The alias to remove @@ -235,32 +230,28 @@ Examples: ### `bin-paths` - List all the active runtime bin paths ### `cache` - Manage the mise cache Run `mise cache` with no args to view the current cache directory. -### `cache clear` - +#### `cache clear` * Aliases: `c` -#### Args +**Args:** * `[PLUGIN]...` – Plugin(s) to clear cache for e.g.: node, python Deletes all cache files in mise ### `completion` - -#### Args +**Args:** * `[SHELL]` – Shell type to generate completions for -#### Flags +**Flags:** * `-s,--shell ` – Shell type to generate completions for Generate shell completions @@ -271,18 +262,16 @@ Examples: ### `config` - * Aliases: `cfg` -#### Flags +**Flags:** * `--no-header` – Do not print table header [experimental] Manage config files -### `config ls` +#### `config ls` - -#### Flags +**Flags:** * `--no-header` – Do not print table header [experimental] List config files currently in use @@ -290,11 +279,10 @@ Examples: $ mise config ls -### `config generate` - +#### `config generate` * Aliases: `g` -#### Flags +**Flags:** * `-o,--output ` – Output to file instead of stdout [experimental] Generate an .mise.toml file @@ -304,8 +292,7 @@ Examples: ### `current` - -#### Args +**Args:** * `[PLUGIN]` – Plugin to show versions of e.g.: ruby, node, cargo:eza, npm:prettier, etc @@ -331,7 +318,6 @@ Examples: ### `deactivate` - Disable mise for current shell session This can be used to temporarily disable mise in a shell session. @@ -344,7 +330,6 @@ Examples: ### `direnv` - Output direnv function to use mise inside direnv See https://mise.rtx.dev/direnv.html for more information @@ -353,8 +338,7 @@ Because this generates the legacy files based on currently installed plugins, you should run this command after installing new plugins. Otherwise direnv may not know to update environment variables when legacy file versions change. -### `direnv activate` - +#### `direnv activate` Output direnv function to use mise inside direnv @@ -371,7 +355,6 @@ Examples: ### `doctor` - Check mise installation for possible problems. Examples: $ mise doctor @@ -379,13 +362,12 @@ Examples: ### `env` - * Aliases: `e` -#### Args +**Args:** * `[TOOL@VERSION]...` – Tool(s) to use -#### Flags +**Flags:** * `-s,--shell ` – Shell type to generate environment variables for * `-J,--json` – Output in JSON format @@ -401,14 +383,13 @@ Examples: ### `exec` - * Aliases: `x` -#### Args +**Args:** * `[TOOL@VERSION]...` – Tool(s) to start e.g.: node@20 python@3.10 * `[COMMAND]...` – Command string to execute (same as --command) -#### Flags +**Flags:** * `-c,--command ` – Command string to execute * `-j,--jobs ` – Number of jobs to run in parallel @@ -436,8 +417,7 @@ Examples: ### `implode` - -#### Flags +**Flags:** * `--config` – Also remove config directory * `-n,--dry-run` – List directories that would be removed without actually removing them @@ -446,13 +426,12 @@ Removes mise CLI and all related data Skips config directory by default. ### `install` - * Aliases: `i` -#### Args +**Args:** * `[TOOL@VERSION]...` – Tool(s) to install e.g.: node@20 -#### Flags +**Flags:** * `-f,--force` – Force reinstall even if already installed * `-j,--jobs ` – Number of jobs to run in parallel @@ -475,13 +454,12 @@ Examples: ### `latest` - -#### Args +**Args:** * `` – Tool to get the latest version of * `[ASDF_VERSION]` – The version prefix to use when querying the latest version same as the first argument after the "@" used for asdf compatibility -#### Flags +**Flags:** * `-i,--installed` – Show latest installed instead of available version Gets the latest available version for a plugin @@ -494,15 +472,14 @@ Examples: ### `link` - * Aliases: `ln` -#### Args +**Args:** * `` – Tool name and version to create a symlink for * `` – The local path to the tool version e.g.: ~/.nvm/versions/node/v20.0.0 -#### Flags +**Flags:** * `-f,--force` – Overwrite an existing tool version if it exists Symlinks a tool version into mise @@ -521,13 +498,12 @@ Examples: ### `ls` - * Aliases: `list` -#### Args +**Args:** * `[PLUGIN]...` – Only show tool versions from [PLUGIN] -#### Flags +**Flags:** * `-p,--plugin ` – * `-c,--current` – Only show tool versions currently specified in a .tool-versions/.mise.toml @@ -566,14 +542,13 @@ Examples: ### `ls-remote` - -#### Args +**Args:** * `[TOOL@VERSION]` – Plugin to get versions for * `[PREFIX]` – The version prefix to use when querying the latest version same as the first argument after the "@" -#### Flags +**Flags:** * `--all` – Show all installed plugins and versions List runtime versions available for install @@ -595,8 +570,7 @@ Examples: ### `outdated` - -#### Args +**Args:** * `[TOOL@VERSION]...` – Tool(s) to show outdated versions for e.g.: node@20 python@3.10 @@ -615,10 +589,9 @@ Examples: ### `plugins` - * Aliases: `p` -#### Flags +**Flags:** * `-a,--all` – list all available remote plugins @@ -635,10 +608,9 @@ e.g.: https://github.com/asdf-vm/asdf-node.git e.g.: main 1234abc Manage plugins -### `plugins install` - +#### `plugins install` * Aliases: `i`, `a`, `add` -#### Args +**Args:** * `[NEW_PLUGIN]` – The name of the plugin to install e.g.: node, ruby @@ -646,7 +618,7 @@ Can specify multiple plugins: `mise plugins install node ruby python` * `[GIT_URL]` – The git url of the plugin * `[REST]...` – -#### Flags +**Flags:** * `-f,--force` – Reinstall even if plugin exists * `-a,--all` – Install all missing plugins @@ -674,17 +646,16 @@ Examples: $ mise plugins install node https://github.com/mise-plugins/rtx-nodejs.git#v1.0.0 -### `plugins link` - +#### `plugins link` * Aliases: `ln` -#### Args +**Args:** * `` – The name of the plugin e.g.: node, ruby * `[PATH]` – The local path to the plugin e.g.: ./mise-node -#### Flags +**Flags:** * `-f,--force` – Overwrite existing plugin Symlinks a plugin into mise @@ -698,11 +669,10 @@ Examples: $ mise plugins link ./mise-node -### `plugins ls` - +#### `plugins ls` * Aliases: `list` -#### Flags +**Flags:** * `-a,--all` – List all available remote plugins Same as `mise plugins ls-remote` @@ -729,11 +699,10 @@ Examples: ruby https://github.com/asdf-vm/asdf-ruby.git -### `plugins ls-remote` - +#### `plugins ls-remote` * Aliases: `list-remote`, `list-all` -#### Flags +**Flags:** * `-u,--urls` – Show the git url for each plugin e.g.: https://github.com/mise-plugins/rtx-nodejs.git * `--only-names` – Only show the name of each plugin by default it will show a "*" next to installed plugins @@ -746,14 +715,13 @@ Examples: $ mise plugins ls-remote -### `plugins uninstall` - +#### `plugins uninstall` * Aliases: `remove`, `rm` -#### Args +**Args:** * `[PLUGIN]...` – Plugin(s) to remove -#### Flags +**Flags:** * `-p,--purge` – Also remove the plugin's installs, downloads, and cache * `-a,--all` – Remove all plugins @@ -762,14 +730,13 @@ Examples: $ mise uninstall node -### `plugins update` - +#### `plugins update` * Aliases: `upgrade` -#### Args +**Args:** * `[PLUGIN]...` – Plugin(s) to update -#### Flags +**Flags:** * `-j,--jobs ` – Number of jobs to run in parallel Default: 4 @@ -783,12 +750,11 @@ Examples: ### `prune` - -#### Args +**Args:** * `[PLUGIN]...` – Prune only versions from this plugin(s) -#### Flags +**Flags:** * `-n,--dry-run` – Do not actually delete anything Delete unused versions of tools @@ -804,8 +770,7 @@ Examples: ### `reshim` - -#### Args +**Args:** * `[PLUGIN]` – * `[VERSION]` – @@ -832,16 +797,15 @@ Examples: ### `run` - * Aliases: `r` -#### Args +**Args:** * `[TASK]` – Task to run Can specify multiple tasks by separating with `:::` e.g.: mise run task1 arg1 arg2 ::: task2 arg1 arg2 * `[ARGS]...` – Arguments to pass to the task. Use ":::" to separate tasks -#### Flags +**Flags:** * `-C,--cd ` – Change to this directory before executing the command * `-n,--dry-run` – Don't actually run the task(s), just print them in order of execution @@ -902,12 +866,11 @@ Examples: ### `self-update` - -#### Args +**Args:** * `[VERSION]` – Update to a specific version -#### Flags +**Flags:** * `-f,--force` – Update even if already up to date * `--no-plugins` – Disable auto-updating plugins @@ -918,13 +881,12 @@ Uses the GitHub Releases API to find the latest release and binary By default, this will also update any installed plugins ### `set` - -#### Args +**Args:** * `[ENV_VARS]...` – Environment variable(s) to set e.g.: NODE_ENV=production -#### Flags +**Flags:** * `--file ` – The TOML file to update @@ -949,12 +911,10 @@ Examples: ### `settings` - Manage settings -### `settings get` - -#### Args +#### `settings get` +**Args:** * `` – The setting to show @@ -969,8 +929,7 @@ Examples: true -### `settings ls` - +#### `settings ls` * Aliases: `list` Show current settings @@ -984,10 +943,9 @@ Examples: legacy_version_file = false -### `settings set` - +#### `settings set` * Aliases: `add`, `create` -#### Args +**Args:** * `` – The setting to set * `` – The value to set @@ -999,10 +957,9 @@ Examples: $ mise settings set legacy_version_file true -### `settings unset` - +#### `settings unset` * Aliases: `rm`, `remove`, `delete`, `del` -#### Args +**Args:** * `` – The setting to remove @@ -1014,13 +971,12 @@ Examples: ### `shell` - * Aliases: `sh` -#### Args +**Args:** * `[TOOL@VERSION]...` – Tool(s) to use -#### Flags +**Flags:** * `-j,--jobs ` – Number of jobs to run in parallel [default: 4] @@ -1037,13 +993,11 @@ Examples: ### `sync` - Add tool versions from external tools to mise -### `sync node` - +#### `sync node` -#### Flags +**Flags:** * `--brew` – Get tool versions from Homebrew * `--nvm` – Get tool versions from nvm @@ -1057,10 +1011,9 @@ Examples: $ mise use -g node@18 - uses Homebrew-provided node -### `sync python` +#### `sync python` - -#### Flags +**Flags:** * `--pyenv` – Get tool versions from pyenv Symlinks all tool versions from an external tool into mise @@ -1073,10 +1026,9 @@ Examples: ### `task` - * Aliases: `t` -#### Flags +**Flags:** * `--no-header` – Do not print table header * `--hidden` – Show hidden tasks @@ -1085,15 +1037,14 @@ Examples: $ mise task ls -### `task deps` - -#### Args +#### `task deps` +**Args:** * `[TASKS]...` – Tasks to show dependencies for Can specify multiple tasks by separating with spaces e.g.: mise task deps lint test check -#### Flags +**Flags:** * `--dot` – Display dependencies in DOT format [experimental] Display a tree visualization of a dependency graph @@ -1108,13 +1059,12 @@ Examples: Shows dependencies in DOT format -### `task edit` - -#### Args +#### `task edit` +**Args:** * `` – Task to edit -#### Flags +**Flags:** * `-p,--path` – Display the path to the task instead of editing it [experimental] Edit a task with $EDITOR @@ -1125,10 +1075,9 @@ Examples: $ mise task edit test -### `task ls` +#### `task ls` - -#### Flags +**Flags:** * `--no-header` – Do not print table header * `--hidden` – Show hidden tasks @@ -1143,17 +1092,16 @@ Examples: $ mise task ls -### `task run` - +#### `task run` * Aliases: `r` -#### Args +**Args:** * `[TASK]` – Task to run Can specify multiple tasks by separating with `:::` e.g.: mise run task1 arg1 arg2 ::: task2 arg1 arg2 * `[ARGS]...` – Arguments to pass to the task. Use ":::" to separate tasks -#### Flags +**Flags:** * `-C,--cd ` – Change to this directory before executing the command * `-n,--dry-run` – Don't actually run the task(s), just print them in order of execution @@ -1214,12 +1162,11 @@ Examples: ### `trust` - -#### Args +**Args:** * `[CONFIG_FILE]` – The config file to trust -#### Flags +**Flags:** * `-a,--all` – Trust all config files in the current directory and its parents * `--untrust` – No longer trust this config @@ -1241,13 +1188,12 @@ Examples: ### `uninstall` - * Aliases: `remove`, `rm` -#### Args +**Args:** * `[TOOL@VERSION]...` – Tool(s) to remove -#### Flags +**Flags:** * `-a,--all` – Delete all installed versions * `-n,--dry-run` – Do not actually delete anything @@ -1259,13 +1205,12 @@ Examples: ### `unset` - -#### Args +**Args:** * `[KEYS]...` – Environment variable(s) to remove e.g.: NODE_ENV -#### Flags +**Flags:** * `-f,--file ` – Specify a file to use instead of ".mise.toml" * `-g,--global` – Use the global config file @@ -1274,15 +1219,14 @@ Remove environment variable(s) from the config file By default this command modifies ".mise.toml" in the current directory. ### `upgrade` - * Aliases: `up` -#### Args +**Args:** * `[TOOL@VERSION]...` – Tool(s) to upgrade e.g.: node@20 python@3.10 If not specified, all current tools will be upgraded -#### Flags +**Flags:** * `-n,--dry-run` – Just print what would be done, don't actually do it * `-j,--jobs ` – Number of jobs to run in parallel @@ -1293,19 +1237,17 @@ Upgrades outdated tool versions ### `usage` - Generate usage spec ### `use` - * Aliases: `u` -#### Args +**Args:** * `[TOOL@VERSION]...` – Tool(s) to add to config file e.g.: node@20, cargo:ripgrep@latest npm:prettier@3 If no version is specified, it will default to @latest -#### Flags +**Flags:** * `-f,--force` – Force reinstall even if already installed * `--fuzzy` – Save fuzzy version to config file @@ -1345,17 +1287,15 @@ Examples: ### `version` - Show mise version ### `watch` - * Aliases: `w` -#### Args +**Args:** * `[ARGS]...` – Extra arguments -#### Flags +**Flags:** * `-t,--task ` – Task to run * `-g,--glob ` – Files to watch @@ -1375,8 +1315,7 @@ Examples: ### `where` - -#### Args +**Args:** * `` – Tool(s) to look up e.g.: ruby@3 @@ -1403,12 +1342,11 @@ Examples: ### `which` - -#### Args +**Args:** * `` – The bin name to look up -#### Flags +**Flags:** * `--plugin` – Show the plugin name instead of the path * `--version` – Show the version instead of the path @@ -1424,4 +1362,8 @@ Examples: 20.0.0 +### `zzz` + +Sleeps for a while. The amount of time is determined by the --timeout option. + diff --git a/examples/docs/MISE_MULTI.md b/examples/docs/MISE_MULTI.md index d57f78d..6c29ee6 100644 --- a/examples/docs/MISE_MULTI.md +++ b/examples/docs/MISE_MULTI.md @@ -54,68 +54,68 @@ foooooooo ## CLI Command Reference -* [`activate`](#activate) -* [`alias`](#alias) -* [`alias get`](#alias-get) -* [`alias ls`](#alias-ls) -* [`alias set`](#alias-set) -* [`alias unset`](#alias-unset) -* [`bin-paths`](#bin-paths) -* [`cache`](#cache) -* [`cache clear`](#cache-clear) -* [`completion`](#completion) -* [`config`](#config) -* [`config ls`](#config-ls) -* [`config generate`](#config-generate) -* [`current`](#current) -* [`deactivate`](#deactivate) -* [`direnv`](#direnv) -* [`direnv activate`](#direnv-activate) -* [`doctor`](#doctor) -* [`env`](#env) -* [`exec`](#exec) -* [`implode`](#implode) -* [`install`](#install) -* [`latest`](#latest) -* [`link`](#link) -* [`ls`](#ls) -* [`ls-remote`](#ls-remote) -* [`outdated`](#outdated) -* [`plugins`](#plugins) -* [`plugins install`](#plugins-install) -* [`plugins link`](#plugins-link) -* [`plugins ls`](#plugins-ls) -* [`plugins ls-remote`](#plugins-ls-remote) -* [`plugins uninstall`](#plugins-uninstall) -* [`plugins update`](#plugins-update) -* [`prune`](#prune) -* [`reshim`](#reshim) -* [`run`](#run) -* [`self-update`](#self-update) -* [`set`](#set) -* [`settings`](#settings) -* [`settings get`](#settings-get) -* [`settings ls`](#settings-ls) -* [`settings set`](#settings-set) -* [`settings unset`](#settings-unset) -* [`shell`](#shell) -* [`sync`](#sync) -* [`sync node`](#sync-node) -* [`sync python`](#sync-python) -* [`task`](#task) -* [`task deps`](#task-deps) -* [`task edit`](#task-edit) -* [`task ls`](#task-ls) -* [`task run`](#task-run) -* [`trust`](#trust) -* [`uninstall`](#uninstall) -* [`unset`](#unset) -* [`upgrade`](#upgrade) -* [`usage`](#usage) -* [`use`](#use) -* [`version`](#version) -* [`watch`](#watch) -* [`where`](#where) -* [`which`](#which) +* [`activate`](./cli-reference/activate.md) +* [`alias`](./cli-reference/alias.md) +* [`alias get`](./cli-reference/alias/get.md) +* [`alias ls`](./cli-reference/alias/ls.md) +* [`alias set`](./cli-reference/alias/set.md) +* [`alias unset`](./cli-reference/alias/unset.md) +* [`bin-paths`](./cli-reference/bin-paths.md) +* [`cache`](./cli-reference/cache.md) +* [`cache clear`](./cli-reference/cache/clear.md) +* [`completion`](./cli-reference/completion.md) +* [`config`](./cli-reference/config.md) +* [`config ls`](./cli-reference/config/ls.md) +* [`config generate`](./cli-reference/config/generate.md) +* [`current`](./cli-reference/current.md) +* [`deactivate`](./cli-reference/deactivate.md) +* [`direnv`](./cli-reference/direnv.md) +* [`direnv activate`](./cli-reference/direnv/activate.md) +* [`doctor`](./cli-reference/doctor.md) +* [`env`](./cli-reference/env.md) +* [`exec`](./cli-reference/exec.md) +* [`implode`](./cli-reference/implode.md) +* [`install`](./cli-reference/install.md) +* [`latest`](./cli-reference/latest.md) +* [`link`](./cli-reference/link.md) +* [`ls`](./cli-reference/ls.md) +* [`ls-remote`](./cli-reference/ls-remote.md) +* [`outdated`](./cli-reference/outdated.md) +* [`plugins`](./cli-reference/plugins.md) +* [`plugins install`](./cli-reference/plugins/install.md) +* [`plugins link`](./cli-reference/plugins/link.md) +* [`plugins ls`](./cli-reference/plugins/ls.md) +* [`plugins ls-remote`](./cli-reference/plugins/ls-remote.md) +* [`plugins uninstall`](./cli-reference/plugins/uninstall.md) +* [`plugins update`](./cli-reference/plugins/update.md) +* [`prune`](./cli-reference/prune.md) +* [`reshim`](./cli-reference/reshim.md) +* [`run`](./cli-reference/run.md) +* [`self-update`](./cli-reference/self-update.md) +* [`set`](./cli-reference/set.md) +* [`settings`](./cli-reference/settings.md) +* [`settings get`](./cli-reference/settings/get.md) +* [`settings ls`](./cli-reference/settings/ls.md) +* [`settings set`](./cli-reference/settings/set.md) +* [`settings unset`](./cli-reference/settings/unset.md) +* [`shell`](./cli-reference/shell.md) +* [`sync`](./cli-reference/sync.md) +* [`sync node`](./cli-reference/sync/node.md) +* [`sync python`](./cli-reference/sync/python.md) +* [`task`](./cli-reference/task.md) +* [`task deps`](./cli-reference/task/deps.md) +* [`task edit`](./cli-reference/task/edit.md) +* [`task ls`](./cli-reference/task/ls.md) +* [`task run`](./cli-reference/task/run.md) +* [`trust`](./cli-reference/trust.md) +* [`uninstall`](./cli-reference/uninstall.md) +* [`unset`](./cli-reference/unset.md) +* [`upgrade`](./cli-reference/upgrade.md) +* [`usage`](./cli-reference/usage.md) +* [`use`](./cli-reference/use.md) +* [`version`](./cli-reference/version.md) +* [`watch`](./cli-reference/watch.md) +* [`where`](./cli-reference/where.md) +* [`which`](./cli-reference/which.md) diff --git a/examples/docs/cli-reference/activate.md b/examples/docs/cli-reference/activate.md index c1ed4a9..30e8674 100644 --- a/examples/docs/cli-reference/activate.md +++ b/examples/docs/cli-reference/activate.md @@ -1,5 +1,4 @@ -### `activate` - +# `mise activate` #### Args * `[SHELL_TYPE]` – Shell type to generate the script for diff --git a/examples/docs/cli-reference/alias.md b/examples/docs/cli-reference/alias.md index 0999319..b257646 100644 --- a/examples/docs/cli-reference/alias.md +++ b/examples/docs/cli-reference/alias.md @@ -1,5 +1,4 @@ -### `alias` - +# `mise alias` * Aliases: `a` #### Flags diff --git a/examples/docs/cli-reference/alias/get.md b/examples/docs/cli-reference/alias/get.md index 1f5ad49..175d9a6 100644 --- a/examples/docs/cli-reference/alias/get.md +++ b/examples/docs/cli-reference/alias/get.md @@ -1,5 +1,4 @@ -### `alias get` - +# `mise alias get` #### Args * `` – The plugin to show the alias for diff --git a/examples/docs/cli-reference/alias/ls.md b/examples/docs/cli-reference/alias/ls.md index 7d82e76..65c9e61 100644 --- a/examples/docs/cli-reference/alias/ls.md +++ b/examples/docs/cli-reference/alias/ls.md @@ -1,5 +1,4 @@ -### `alias ls` - +# `mise alias ls` * Aliases: `list` #### Args diff --git a/examples/docs/cli-reference/alias/set.md b/examples/docs/cli-reference/alias/set.md index 526b37b..05b8aa3 100644 --- a/examples/docs/cli-reference/alias/set.md +++ b/examples/docs/cli-reference/alias/set.md @@ -1,5 +1,4 @@ -### `alias set` - +# `mise alias set` * Aliases: `add`, `create` #### Args diff --git a/examples/docs/cli-reference/alias/unset.md b/examples/docs/cli-reference/alias/unset.md index a41f149..d4b44e9 100644 --- a/examples/docs/cli-reference/alias/unset.md +++ b/examples/docs/cli-reference/alias/unset.md @@ -1,5 +1,4 @@ -### `alias unset` - +# `mise alias unset` * Aliases: `rm`, `remove`, `delete`, `del` #### Args diff --git a/examples/docs/cli-reference/bin-paths.md b/examples/docs/cli-reference/bin-paths.md index c7e0019..c38c164 100644 --- a/examples/docs/cli-reference/bin-paths.md +++ b/examples/docs/cli-reference/bin-paths.md @@ -1,4 +1,3 @@ -### `bin-paths` - +# `mise bin-paths` List all the active runtime bin paths diff --git a/examples/docs/cli-reference/cache.md b/examples/docs/cli-reference/cache.md index 40c5b1e..981e4bb 100644 --- a/examples/docs/cli-reference/cache.md +++ b/examples/docs/cli-reference/cache.md @@ -1,5 +1,4 @@ -### `cache` - +# `mise cache` Manage the mise cache diff --git a/examples/docs/cli-reference/cache/clear.md b/examples/docs/cli-reference/cache/clear.md index 11eb416..7aa74d6 100644 --- a/examples/docs/cli-reference/cache/clear.md +++ b/examples/docs/cli-reference/cache/clear.md @@ -1,5 +1,4 @@ -### `cache clear` - +# `mise cache clear` * Aliases: `c` #### Args diff --git a/examples/docs/cli-reference/completion.md b/examples/docs/cli-reference/completion.md index 8b68394..48ff493 100644 --- a/examples/docs/cli-reference/completion.md +++ b/examples/docs/cli-reference/completion.md @@ -1,5 +1,4 @@ -### `completion` - +# `mise completion` #### Args * `[SHELL]` – Shell type to generate completions for diff --git a/examples/docs/cli-reference/config.md b/examples/docs/cli-reference/config.md index 4d8e423..75de1ad 100644 --- a/examples/docs/cli-reference/config.md +++ b/examples/docs/cli-reference/config.md @@ -1,5 +1,4 @@ -### `config` - +# `mise config` * Aliases: `cfg` #### Flags diff --git a/examples/docs/cli-reference/config/generate.md b/examples/docs/cli-reference/config/generate.md index 71598df..d3629ad 100644 --- a/examples/docs/cli-reference/config/generate.md +++ b/examples/docs/cli-reference/config/generate.md @@ -1,5 +1,4 @@ -### `config generate` - +# `mise config generate` * Aliases: `g` #### Flags diff --git a/examples/docs/cli-reference/config/ls.md b/examples/docs/cli-reference/config/ls.md index a8623ab..06c5a30 100644 --- a/examples/docs/cli-reference/config/ls.md +++ b/examples/docs/cli-reference/config/ls.md @@ -1,5 +1,4 @@ -### `config ls` - +# `mise config ls` #### Flags diff --git a/examples/docs/cli-reference/current.md b/examples/docs/cli-reference/current.md index f09191c..f02020c 100644 --- a/examples/docs/cli-reference/current.md +++ b/examples/docs/cli-reference/current.md @@ -1,5 +1,4 @@ -### `current` - +# `mise current` #### Args * `[PLUGIN]` – Plugin to show versions of e.g.: ruby, node, cargo:eza, npm:prettier, etc diff --git a/examples/docs/cli-reference/deactivate.md b/examples/docs/cli-reference/deactivate.md index 3d6eac0..070b429 100644 --- a/examples/docs/cli-reference/deactivate.md +++ b/examples/docs/cli-reference/deactivate.md @@ -1,5 +1,4 @@ -### `deactivate` - +# `mise deactivate` Disable mise for current shell session diff --git a/examples/docs/cli-reference/direnv.md b/examples/docs/cli-reference/direnv.md index 3d395b2..a6d2b79 100644 --- a/examples/docs/cli-reference/direnv.md +++ b/examples/docs/cli-reference/direnv.md @@ -1,5 +1,4 @@ -### `direnv` - +# `mise direnv` Output direnv function to use mise inside direnv diff --git a/examples/docs/cli-reference/direnv/activate.md b/examples/docs/cli-reference/direnv/activate.md index a87d7ec..502b337 100644 --- a/examples/docs/cli-reference/direnv/activate.md +++ b/examples/docs/cli-reference/direnv/activate.md @@ -1,5 +1,4 @@ -### `direnv activate` - +# `mise direnv activate` Output direnv function to use mise inside direnv diff --git a/examples/docs/cli-reference/doctor.md b/examples/docs/cli-reference/doctor.md index 119441f..925acec 100644 --- a/examples/docs/cli-reference/doctor.md +++ b/examples/docs/cli-reference/doctor.md @@ -1,5 +1,4 @@ -### `doctor` - +# `mise doctor` Check mise installation for possible problems. Examples: diff --git a/examples/docs/cli-reference/env.md b/examples/docs/cli-reference/env.md index 7951ba0..739208d 100644 --- a/examples/docs/cli-reference/env.md +++ b/examples/docs/cli-reference/env.md @@ -1,5 +1,4 @@ -### `env` - +# `mise env` * Aliases: `e` #### Args diff --git a/examples/docs/cli-reference/exec.md b/examples/docs/cli-reference/exec.md index 5d92b99..da63db1 100644 --- a/examples/docs/cli-reference/exec.md +++ b/examples/docs/cli-reference/exec.md @@ -1,5 +1,4 @@ -### `exec` - +# `mise exec` * Aliases: `x` #### Args diff --git a/examples/docs/cli-reference/implode.md b/examples/docs/cli-reference/implode.md index 5cc8ff9..85cedec 100644 --- a/examples/docs/cli-reference/implode.md +++ b/examples/docs/cli-reference/implode.md @@ -1,5 +1,4 @@ -### `implode` - +# `mise implode` #### Flags diff --git a/examples/docs/cli-reference/install.md b/examples/docs/cli-reference/install.md index 0d1844b..d976016 100644 --- a/examples/docs/cli-reference/install.md +++ b/examples/docs/cli-reference/install.md @@ -1,5 +1,4 @@ -### `install` - +# `mise install` * Aliases: `i` #### Args diff --git a/examples/docs/cli-reference/latest.md b/examples/docs/cli-reference/latest.md index d1b0552..ab730bc 100644 --- a/examples/docs/cli-reference/latest.md +++ b/examples/docs/cli-reference/latest.md @@ -1,5 +1,4 @@ -### `latest` - +# `mise latest` #### Args * `` – Tool to get the latest version of diff --git a/examples/docs/cli-reference/link.md b/examples/docs/cli-reference/link.md index 783620e..6ebedf6 100644 --- a/examples/docs/cli-reference/link.md +++ b/examples/docs/cli-reference/link.md @@ -1,5 +1,4 @@ -### `link` - +# `mise link` * Aliases: `ln` #### Args diff --git a/examples/docs/cli-reference/ls-remote.md b/examples/docs/cli-reference/ls-remote.md index 4c67df5..210a3ff 100644 --- a/examples/docs/cli-reference/ls-remote.md +++ b/examples/docs/cli-reference/ls-remote.md @@ -1,5 +1,4 @@ -### `ls-remote` - +# `mise ls-remote` #### Args * `[TOOL@VERSION]` – Plugin to get versions for diff --git a/examples/docs/cli-reference/ls.md b/examples/docs/cli-reference/ls.md index eb632ed..aefe48f 100644 --- a/examples/docs/cli-reference/ls.md +++ b/examples/docs/cli-reference/ls.md @@ -1,5 +1,4 @@ -### `ls` - +# `mise ls` * Aliases: `list` #### Args diff --git a/examples/docs/cli-reference/outdated.md b/examples/docs/cli-reference/outdated.md index ba349f1..2ee60a7 100644 --- a/examples/docs/cli-reference/outdated.md +++ b/examples/docs/cli-reference/outdated.md @@ -1,5 +1,4 @@ -### `outdated` - +# `mise outdated` #### Args * `[TOOL@VERSION]...` – Tool(s) to show outdated versions for diff --git a/examples/docs/cli-reference/plugins.md b/examples/docs/cli-reference/plugins.md index b65c366..3310e5f 100644 --- a/examples/docs/cli-reference/plugins.md +++ b/examples/docs/cli-reference/plugins.md @@ -1,5 +1,4 @@ -### `plugins` - +# `mise plugins` * Aliases: `p` #### Flags diff --git a/examples/docs/cli-reference/plugins/install.md b/examples/docs/cli-reference/plugins/install.md index 6b88de2..7e941d9 100644 --- a/examples/docs/cli-reference/plugins/install.md +++ b/examples/docs/cli-reference/plugins/install.md @@ -1,5 +1,4 @@ -### `plugins install` - +# `mise plugins install` * Aliases: `i`, `a`, `add` #### Args diff --git a/examples/docs/cli-reference/plugins/link.md b/examples/docs/cli-reference/plugins/link.md index 8987a9e..f31dfa0 100644 --- a/examples/docs/cli-reference/plugins/link.md +++ b/examples/docs/cli-reference/plugins/link.md @@ -1,5 +1,4 @@ -### `plugins link` - +# `mise plugins link` * Aliases: `ln` #### Args diff --git a/examples/docs/cli-reference/plugins/ls-remote.md b/examples/docs/cli-reference/plugins/ls-remote.md index f02423f..fe50d65 100644 --- a/examples/docs/cli-reference/plugins/ls-remote.md +++ b/examples/docs/cli-reference/plugins/ls-remote.md @@ -1,5 +1,4 @@ -### `plugins ls-remote` - +# `mise plugins ls-remote` * Aliases: `list-remote`, `list-all` #### Flags diff --git a/examples/docs/cli-reference/plugins/ls.md b/examples/docs/cli-reference/plugins/ls.md index ed8e0a1..fdc82a3 100644 --- a/examples/docs/cli-reference/plugins/ls.md +++ b/examples/docs/cli-reference/plugins/ls.md @@ -1,5 +1,4 @@ -### `plugins ls` - +# `mise plugins ls` * Aliases: `list` #### Flags diff --git a/examples/docs/cli-reference/plugins/uninstall.md b/examples/docs/cli-reference/plugins/uninstall.md index 108160d..8c9d2ef 100644 --- a/examples/docs/cli-reference/plugins/uninstall.md +++ b/examples/docs/cli-reference/plugins/uninstall.md @@ -1,5 +1,4 @@ -### `plugins uninstall` - +# `mise plugins uninstall` * Aliases: `remove`, `rm` #### Args diff --git a/examples/docs/cli-reference/plugins/update.md b/examples/docs/cli-reference/plugins/update.md index 029ad75..64c9cef 100644 --- a/examples/docs/cli-reference/plugins/update.md +++ b/examples/docs/cli-reference/plugins/update.md @@ -1,5 +1,4 @@ -### `plugins update` - +# `mise plugins update` * Aliases: `upgrade` #### Args diff --git a/examples/docs/cli-reference/prune.md b/examples/docs/cli-reference/prune.md index 9984574..410a517 100644 --- a/examples/docs/cli-reference/prune.md +++ b/examples/docs/cli-reference/prune.md @@ -1,5 +1,4 @@ -### `prune` - +# `mise prune` #### Args * `[PLUGIN]...` – Prune only versions from this plugin(s) diff --git a/examples/docs/cli-reference/reshim.md b/examples/docs/cli-reference/reshim.md index 0acc25f..a9be669 100644 --- a/examples/docs/cli-reference/reshim.md +++ b/examples/docs/cli-reference/reshim.md @@ -1,5 +1,4 @@ -### `reshim` - +# `mise reshim` #### Args * `[PLUGIN]` – diff --git a/examples/docs/cli-reference/run.md b/examples/docs/cli-reference/run.md index b9d0957..a9d6ca2 100644 --- a/examples/docs/cli-reference/run.md +++ b/examples/docs/cli-reference/run.md @@ -1,5 +1,4 @@ -### `run` - +# `mise run` * Aliases: `r` #### Args diff --git a/examples/docs/cli-reference/self-update.md b/examples/docs/cli-reference/self-update.md index 3840add..4ee1236 100644 --- a/examples/docs/cli-reference/self-update.md +++ b/examples/docs/cli-reference/self-update.md @@ -1,5 +1,4 @@ -### `self-update` - +# `mise self-update` #### Args * `[VERSION]` – Update to a specific version diff --git a/examples/docs/cli-reference/set.md b/examples/docs/cli-reference/set.md index 9cb3ce9..34f2d7d 100644 --- a/examples/docs/cli-reference/set.md +++ b/examples/docs/cli-reference/set.md @@ -1,5 +1,4 @@ -### `set` - +# `mise set` #### Args * `[ENV_VARS]...` – Environment variable(s) to set diff --git a/examples/docs/cli-reference/settings.md b/examples/docs/cli-reference/settings.md index 63c89f9..a533317 100644 --- a/examples/docs/cli-reference/settings.md +++ b/examples/docs/cli-reference/settings.md @@ -1,4 +1,3 @@ -### `settings` - +# `mise settings` Manage settings diff --git a/examples/docs/cli-reference/settings/get.md b/examples/docs/cli-reference/settings/get.md index 825a1bd..bc6d01e 100644 --- a/examples/docs/cli-reference/settings/get.md +++ b/examples/docs/cli-reference/settings/get.md @@ -1,5 +1,4 @@ -### `settings get` - +# `mise settings get` #### Args * `` – The setting to show diff --git a/examples/docs/cli-reference/settings/ls.md b/examples/docs/cli-reference/settings/ls.md index a50c79c..9b9ea47 100644 --- a/examples/docs/cli-reference/settings/ls.md +++ b/examples/docs/cli-reference/settings/ls.md @@ -1,5 +1,4 @@ -### `settings ls` - +# `mise settings ls` * Aliases: `list` Show current settings diff --git a/examples/docs/cli-reference/settings/set.md b/examples/docs/cli-reference/settings/set.md index d20d030..1fec1c7 100644 --- a/examples/docs/cli-reference/settings/set.md +++ b/examples/docs/cli-reference/settings/set.md @@ -1,5 +1,4 @@ -### `settings set` - +# `mise settings set` * Aliases: `add`, `create` #### Args diff --git a/examples/docs/cli-reference/settings/unset.md b/examples/docs/cli-reference/settings/unset.md index 8f4ff8b..5e8b0c8 100644 --- a/examples/docs/cli-reference/settings/unset.md +++ b/examples/docs/cli-reference/settings/unset.md @@ -1,5 +1,4 @@ -### `settings unset` - +# `mise settings unset` * Aliases: `rm`, `remove`, `delete`, `del` #### Args diff --git a/examples/docs/cli-reference/shell.md b/examples/docs/cli-reference/shell.md index e926351..53c50d6 100644 --- a/examples/docs/cli-reference/shell.md +++ b/examples/docs/cli-reference/shell.md @@ -1,5 +1,4 @@ -### `shell` - +# `mise shell` * Aliases: `sh` #### Args diff --git a/examples/docs/cli-reference/sync.md b/examples/docs/cli-reference/sync.md index ff59120..221573c 100644 --- a/examples/docs/cli-reference/sync.md +++ b/examples/docs/cli-reference/sync.md @@ -1,4 +1,3 @@ -### `sync` - +# `mise sync` Add tool versions from external tools to mise diff --git a/examples/docs/cli-reference/sync/node.md b/examples/docs/cli-reference/sync/node.md index 3556a1e..fa2eb5c 100644 --- a/examples/docs/cli-reference/sync/node.md +++ b/examples/docs/cli-reference/sync/node.md @@ -1,5 +1,4 @@ -### `sync node` - +# `mise sync node` #### Flags diff --git a/examples/docs/cli-reference/sync/python.md b/examples/docs/cli-reference/sync/python.md index 685006f..8e01264 100644 --- a/examples/docs/cli-reference/sync/python.md +++ b/examples/docs/cli-reference/sync/python.md @@ -1,5 +1,4 @@ -### `sync python` - +# `mise sync python` #### Flags diff --git a/examples/docs/cli-reference/task.md b/examples/docs/cli-reference/task.md index 9ea3efa..8f3ca16 100644 --- a/examples/docs/cli-reference/task.md +++ b/examples/docs/cli-reference/task.md @@ -1,5 +1,4 @@ -### `task` - +# `mise task` * Aliases: `t` #### Flags diff --git a/examples/docs/cli-reference/task/deps.md b/examples/docs/cli-reference/task/deps.md index d493179..dac004a 100644 --- a/examples/docs/cli-reference/task/deps.md +++ b/examples/docs/cli-reference/task/deps.md @@ -1,5 +1,4 @@ -### `task deps` - +# `mise task deps` #### Args * `[TASKS]...` – Tasks to show dependencies for diff --git a/examples/docs/cli-reference/task/edit.md b/examples/docs/cli-reference/task/edit.md index efcb791..4b0b5f4 100644 --- a/examples/docs/cli-reference/task/edit.md +++ b/examples/docs/cli-reference/task/edit.md @@ -1,5 +1,4 @@ -### `task edit` - +# `mise task edit` #### Args * `` – Task to edit diff --git a/examples/docs/cli-reference/task/ls.md b/examples/docs/cli-reference/task/ls.md index 6bbab3a..e6028a5 100644 --- a/examples/docs/cli-reference/task/ls.md +++ b/examples/docs/cli-reference/task/ls.md @@ -1,5 +1,4 @@ -### `task ls` - +# `mise task ls` #### Flags diff --git a/examples/docs/cli-reference/task/run.md b/examples/docs/cli-reference/task/run.md index 784e223..c8af0b0 100644 --- a/examples/docs/cli-reference/task/run.md +++ b/examples/docs/cli-reference/task/run.md @@ -1,5 +1,4 @@ -### `task run` - +# `mise task run` * Aliases: `r` #### Args diff --git a/examples/docs/cli-reference/trust.md b/examples/docs/cli-reference/trust.md index e8030bb..43648c0 100644 --- a/examples/docs/cli-reference/trust.md +++ b/examples/docs/cli-reference/trust.md @@ -1,5 +1,4 @@ -### `trust` - +# `mise trust` #### Args * `[CONFIG_FILE]` – The config file to trust diff --git a/examples/docs/cli-reference/uninstall.md b/examples/docs/cli-reference/uninstall.md index 7ca1cad..12c3735 100644 --- a/examples/docs/cli-reference/uninstall.md +++ b/examples/docs/cli-reference/uninstall.md @@ -1,5 +1,4 @@ -### `uninstall` - +# `mise uninstall` * Aliases: `remove`, `rm` #### Args diff --git a/examples/docs/cli-reference/unset.md b/examples/docs/cli-reference/unset.md index 4e5b079..4e8fac3 100644 --- a/examples/docs/cli-reference/unset.md +++ b/examples/docs/cli-reference/unset.md @@ -1,5 +1,4 @@ -### `unset` - +# `mise unset` #### Args * `[KEYS]...` – Environment variable(s) to remove diff --git a/examples/docs/cli-reference/upgrade.md b/examples/docs/cli-reference/upgrade.md index 6fcc723..fb6c100 100644 --- a/examples/docs/cli-reference/upgrade.md +++ b/examples/docs/cli-reference/upgrade.md @@ -1,5 +1,4 @@ -### `upgrade` - +# `mise upgrade` * Aliases: `up` #### Args diff --git a/examples/docs/cli-reference/usage.md b/examples/docs/cli-reference/usage.md index ed253a5..50c8007 100644 --- a/examples/docs/cli-reference/usage.md +++ b/examples/docs/cli-reference/usage.md @@ -1,4 +1,3 @@ -### `usage` - +# `mise usage` Generate usage spec diff --git a/examples/docs/cli-reference/use.md b/examples/docs/cli-reference/use.md index 68cc9e6..346ccc9 100644 --- a/examples/docs/cli-reference/use.md +++ b/examples/docs/cli-reference/use.md @@ -1,5 +1,4 @@ -### `use` - +# `mise use` * Aliases: `u` #### Args diff --git a/examples/docs/cli-reference/version.md b/examples/docs/cli-reference/version.md index 92e121a..3694c69 100644 --- a/examples/docs/cli-reference/version.md +++ b/examples/docs/cli-reference/version.md @@ -1,4 +1,3 @@ -### `version` - +# `mise version` Show mise version diff --git a/examples/docs/cli-reference/watch.md b/examples/docs/cli-reference/watch.md index 428458c..0aa842b 100644 --- a/examples/docs/cli-reference/watch.md +++ b/examples/docs/cli-reference/watch.md @@ -1,5 +1,4 @@ -### `watch` - +# `mise watch` * Aliases: `w` #### Args diff --git a/examples/docs/cli-reference/where.md b/examples/docs/cli-reference/where.md index d136da2..4fcddab 100644 --- a/examples/docs/cli-reference/where.md +++ b/examples/docs/cli-reference/where.md @@ -1,5 +1,4 @@ -### `where` - +# `mise where` #### Args * `` – Tool(s) to look up diff --git a/examples/docs/cli-reference/which.md b/examples/docs/cli-reference/which.md index aa4c958..7c4cee3 100644 --- a/examples/docs/cli-reference/which.md +++ b/examples/docs/cli-reference/which.md @@ -1,5 +1,4 @@ -### `which` - +# `mise which` #### Args * `` – The bin name to look up diff --git a/examples/mise.usage.kdl b/examples/mise.usage.kdl index 16df213..bb0c48e 100644 --- a/examples/mise.usage.kdl +++ b/examples/mise.usage.kdl @@ -11,3 +11,8 @@ config { prop "color" default=true env="MISE_COLOR" } + +cmd "zzz" \ + help="Sleeps for a while." \ + long_help="Sleeps for a while. The amount of time is determined by the --timeout option." { +} diff --git a/src/parse/cmd.rs b/src/parse/cmd.rs index 2b752ee..6dbff99 100644 --- a/src/parse/cmd.rs +++ b/src/parse/cmd.rs @@ -26,10 +26,6 @@ pub struct SchemaCmd { } impl SchemaCmd { - pub(crate) fn is_empty(&self) -> bool { - self.args.is_empty() && self.flags.is_empty() && self.subcommands.is_empty() - } - pub(crate) fn parse(ctx: &ParsingContext, node: &NodeHelper) -> Result { node.ensure_args_count(1, 1)?; let mut cmd = Self { @@ -84,6 +80,49 @@ impl SchemaCmd { } Ok(cmd) } + pub(crate) fn is_empty(&self) -> bool { + self.args.is_empty() && self.flags.is_empty() && self.subcommands.is_empty() + } + pub(crate) fn merge(&mut self, other: Self) { + if !other.name.is_empty() { + self.name = other.name; + } + if other.help.is_some() { + self.help = other.help; + } + if other.long_help.is_some() { + self.long_help = other.long_help; + } + if other.before_help.is_some() { + self.before_help = other.before_help; + } + if other.before_long_help.is_some() { + self.before_long_help = other.before_long_help; + } + if other.after_help.is_some() { + self.after_help = other.after_help; + } + if other.after_long_help.is_some() { + self.after_long_help = other.after_long_help; + } + if !other.args.is_empty() { + self.args = other.args; + } + if !other.flags.is_empty() { + self.flags = other.flags; + } + if !other.aliases.is_empty() { + self.aliases = other.aliases; + } + if !other.hidden_aliases.is_empty() { + self.hidden_aliases = other.hidden_aliases; + } + self.hide = other.hide; + self.subcommand_required = other.subcommand_required; + for (name, cmd) in other.subcommands { + self.subcommands.insert(name, cmd); + } + } } impl From<&SchemaCmd> for KdlNode { diff --git a/src/parse/spec.rs b/src/parse/spec.rs index 357e0b1..1743f62 100644 --- a/src/parse/spec.rs +++ b/src/parse/spec.rs @@ -115,15 +115,7 @@ impl Spec { if !other.config.is_empty() { self.config.merge(&other.config); } - for flag in other.cmd.flags { - self.cmd.flags.push(flag); - } - for arg in other.cmd.args { - self.cmd.args.push(arg); - } - for (name, cmd) in other.cmd.subcommands { - self.cmd.subcommands.insert(name, cmd); - } + self.cmd.merge(other.cmd); } }