fix: show usage help when long_about is defined w/o args/flags#8824
fix: show usage help when long_about is defined w/o args/flags#8824
Conversation
…rgs/flags When a task script defines #USAGE long_about (or other metadata directives) but no args or flags, --help now correctly shows the usage-rendered help instead of the generic "This task does not accept any arguments" message. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request enhances the task help system by introducing the has_any_usage_spec function, which ensures that usage-based help is displayed if any usage metadata (such as long_about) is present, even if no arguments or flags are defined. A new end-to-end test was added to verify this behavior. The reviewer identified that spec.about and spec.cmd.help_md were missing from the new check and provided a code suggestion to include them for more comprehensive coverage.
Greptile SummaryThis PR fixes a display bug where Key changes:
Confidence Score: 5/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["mise run <task> --help"] --> B["parse_usage_spec_for_display()"]
B --> C["populate_spec_metadata()"]
C --> D{"has_any_usage_spec(spec)?"}
D -->|"args / flags / subcommands\nOR about / about_long / about_md\nOR help_long / help_md\nOR before_help / after_help / after_help_long\nOR examples"| E["render_help() — usage-based help"]
D -->|"None of the above\n(note: before_help_long is\nauto-set for depends, so excluded)"| F["display_task_help() — generic fallback"]
Reviews (4): Last reviewed commit: "fix(task): include before_help in has_an..." | Re-trigger Greptile |
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
before_help_long is set automatically by populate_spec_metadata() for tasks with dependencies, causing a false positive that would switch those tasks to usage-based help rendering. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Only before_help_long is auto-populated by populate_spec_metadata() for tasks with dependencies. before_help (without _long) is only set from explicit #USAGE directives, so it's safe to include. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
### 🚀 Features - add azd (Azure Developer CLI) to registry by @rajeshkamal5050 in [#8828](#8828) ### 🐛 Bug Fixes - **(aqua)** skip registry lookup for linked versions in list_bin_paths by @nikobockerman in [#8801](#8801) - **(rust)** handle rustup check exit code 100 as non-error by @shalk in [#8832](#8832) - **(task)** resolve bare aliases in monorepo with config_roots by @nkakouros in [#8819](#8819) - show usage help when long_about is defined w/o args/flags by @nkakouros in [#8824](#8824) ### 📚 Documentation - fix serif font in sidebar and increase heading sizes by @jdx in [#8831](#8831) - fix #vscode link in ide integration page by @jedymatt in [#8833](#8833) - fix nested Markdown code fences by @muzimuzhi in [#8835](#8835) ### New Contributors - @shalk made their first contribution in [#8832](#8832) - @jedymatt made their first contribution in [#8833](#8833) - @nikobockerman made their first contribution in [#8801](#8801) - @rajeshkamal5050 made their first contribution in [#8828](#8828) ## 📦 Aqua Registry Updates #### New Packages (2) - [`gastownhall/beads`](https://github.com/gastownhall/beads) - [`getdbt.com/dbt-fusion`](https://github.com/getdbt.com/dbt-fusion) #### Updated Packages (2) - [`Azure/azure-dev`](https://github.com/Azure/azure-dev) - [`magefile/mage`](https://github.com/magefile/mage)
Description:
Summary
#USAGE long_about(or other metadata-only directives likebefore_help,after_help,examples) but noargorflag,mise run task --helpnow correctly renders usage-based help instead of the generic "This task does not accept any arguments" message.has_any_usage_spec()function that checks for any meaningful usage spec content (not just args/flags/subcommands), used only for the help display decision. The existinghas_any_args_defined()remains unchanged for runtime argument parsing.Steps to reproduce
Test plan