microsoft / microsoft/just

bug: task help generation via option() doesn't work

Open
#503 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
2k
Forks
97
PR merge metrics
No merged PRs in 30d

Description

Repro

const { task, logger, option, argv } = require('just-task');

option('name', {describe: 'user name or something'});

task('blimey', 'An exclamation of surprise.', function() {
  logger.info(`blimey! ${argv().name}`);
});
Actual behaviour

Basically --help output always invokes yargs default help command.

just --help

image

just blimey --help

image

Expected behaviour
just blimey --help

Options:
  --name    user name or something                                                 [string]
  --help     Show help                                                 [boolean]
  --version  Show version number                                       [boolean]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the reported just blimey --help reproduction and tracing how option() registrations reach help generation. The fix is done when task-specific options such as --name, along with help and version entries, appear instead of only the default help output.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.