Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mise.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions mise.usage.kdl
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
min_usage_version "1.3"
min_usage_version "2.11"
name mise
bin mise
about "The front-end to your dev env"
long_about "mise manages dev tools, env vars, and runs tasks. https://github.com/jdx/mise"
default_subcommand run
usage "Usage: mise [OPTIONS] [TASK] [COMMAND]"
flag "-c --continue-on-error" help="Continue running tasks even if one fails" hide=#true
flag "-C --cd" help="Change directory before running command" global=#true {
Expand Down Expand Up @@ -676,7 +677,7 @@ cmd reshim help="Creates new shims based on bin paths from currently installed t
arg "[PLUGIN]" required=#false hide=#true
arg "[VERSION]" required=#false hide=#true
}
cmd run help="Run task(s)" {
cmd run restart_token=::: help="Run task(s)" {
alias r
long_help "Run task(s)\n\nThis command will run a task, or multiple tasks in parallel.\nTasks may have dependencies on other tasks or on source files.\nIf source is configured on a task, it will only run if the source\nfiles have changed.\n\nTasks can be defined in mise.toml or as standalone scripts.\nIn mise.toml, tasks take this form:\n\n [tasks.build]\n run = \"npm run build\"\n sources = [\"src/**/*.ts\"]\n outputs = [\"dist/**/*.js\"]\n\nAlternatively, tasks can be defined as standalone scripts.\nThese must be located in `mise-tasks`, `.mise-tasks`, `.mise/tasks`, `mise/tasks` or\n`.config/mise/tasks`.\nThe name of the script will be the name of the tasks.\n\n $ cat .mise/tasks/build<<EOF\n #!/usr/bin/env bash\n npm run build\n EOF\n $ mise run build"
after_long_help "Examples:\n\n # Runs the \"lint\" tasks. This needs to either be defined in mise.toml\n # or as a standalone script. See the project README for more information.\n $ mise run lint\n\n # Forces the \"build\" tasks to run even if its sources are up-to-date.\n $ mise run build --force\n\n # Run \"test\" with stdin/stdout/stderr all connected to the current terminal.\n # This forces `--jobs=1` to prevent interleaving of output.\n $ mise run test --raw\n\n # Runs the \"lint\", \"test\", and \"check\" tasks in parallel.\n $ mise run lint ::: test ::: check\n\n # Execute multiple tasks each with their own arguments.\n $ mise run cmd1 arg1 arg2 ::: cmd2 arg1 arg2\n"
Expand Down Expand Up @@ -983,7 +984,7 @@ cmd tasks help="Manage tasks" {
}
flag --usage hide=#true global=#true
}
cmd run help="Run task(s)" {
cmd run restart_token=::: help="Run task(s)" {
alias r
long_help "Run task(s)\n\nThis command will run a task, or multiple tasks in parallel.\nTasks may have dependencies on other tasks or on source files.\nIf source is configured on a task, it will only run if the source\nfiles have changed.\n\nTasks can be defined in mise.toml or as standalone scripts.\nIn mise.toml, tasks take this form:\n\n [tasks.build]\n run = \"npm run build\"\n sources = [\"src/**/*.ts\"]\n outputs = [\"dist/**/*.js\"]\n\nAlternatively, tasks can be defined as standalone scripts.\nThese must be located in `mise-tasks`, `.mise-tasks`, `.mise/tasks`, `mise/tasks` or\n`.config/mise/tasks`.\nThe name of the script will be the name of the tasks.\n\n $ cat .mise/tasks/build<<EOF\n #!/usr/bin/env bash\n npm run build\n EOF\n $ mise run build"
after_long_help "Examples:\n\n # Runs the \"lint\" tasks. This needs to either be defined in mise.toml\n # or as a standalone script. See the project README for more information.\n $ mise run lint\n\n # Forces the \"build\" tasks to run even if its sources are up-to-date.\n $ mise run build --force\n\n # Run \"test\" with stdin/stdout/stderr all connected to the current terminal.\n # This forces `--jobs=1` to prevent interleaving of output.\n $ mise run test --raw\n\n # Runs the \"lint\", \"test\", and \"check\" tasks in parallel.\n $ mise run lint ::: test ::: check\n\n # Execute multiple tasks each with their own arguments.\n $ mise run cmd1 arg1 arg2 ::: cmd2 arg1 arg2\n"
Expand Down
9 changes: 8 additions & 1 deletion src/cli/usage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,26 @@ impl Usage {
pub fn run(self) -> Result<()> {
let cli = Cli::command().version(Resettable::Reset);
let mut spec: usage::Spec = cli.into();

// Enable "naked" task completions: `mise foo` completes like `mise run foo`
spec.default_subcommand = Some("run".to_string());

let run = spec.cmd.subcommands.get_mut("run").unwrap();
run.args = vec![];
run.mounts.push(usage::SpecMount {
run: "mise tasks --usage".to_string(),
});
// Enable completions after ::: separator for multi-task invocations
run.restart_token = Some(":::".to_string());

let tasks = spec.cmd.subcommands.get_mut("tasks").unwrap();
let tasks_run = tasks.subcommands.get_mut("run").unwrap();
tasks_run.mounts.push(usage::SpecMount {
run: "mise tasks --usage".to_string(),
});
tasks_run.restart_token = Some(":::".to_string());

let min_version = r#"min_usage_version "1.3""#;
let min_version = r#"min_usage_version "2.11""#;
let extra = include_str!("../assets/mise-extra.usage.kdl").trim();
println!("{min_version}\n{}\n{extra}", spec.to_string().trim());
Ok(())
Expand Down
4 changes: 4 additions & 0 deletions src/task/task_script_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,8 @@ impl TaskScriptParser {
long,
default,
var,
var_min: None,
var_max: None,
hide,
global,
count,
Expand Down Expand Up @@ -461,6 +463,8 @@ impl TaskScriptParser {
long,
default,
var,
var_min: None,
var_max: None,
hide,
global,
count,
Expand Down
Loading