Commands in help don't render correctly in Deno · Issue #2050 · yargs/yargs · GitHub
Skip to content

Commands in help don't render correctly in Deno #2050

Description

@audrow

It seems that commands in help don't render correctly with Deno. Specifically, they don't show the file name and they also don't work with a compiled executable.

For example, with the following file,

// minimum-cli.ts

import yargs from "https://deno.land/x/yargs@v17.2.1-deno/deno.ts";

yargs(Deno.args)
  .command("my-command")
  .strict()
  .parse()

I get the following help screen:

$ deno run minimum-cli.ts --help
Check file:///Users/audrow/Code/minimum-cli.ts
deno run [command]

Commands:
  deno run my-command

Options:
  --help     Show help                                                 [boolean]
  --version  Show version number                                       [boolean]

For my-command, it should say deno run minimum-cli.ts my-command, instead of deno run my-command.

It is also true that this doesn't work correctly when Deno is compiled. For example:

$ deno compile --output out minimum-cli.ts
Check file:///Users/audrow/Code/minimum-cli.ts
Bundle file:///Users/audrow/Code/minimum-cli.ts
Compile file:///Users/audrow/Code/minimum-cli.ts
Emit out
$ ./out --help
deno run [command]

Commands:
  deno run my-command

Options:
  --help     Show help                                                 [boolean]
  --version  Show version number                                       [boolean]

In the compiled case, the command should say ./out my-command.


I am using Deno version 1.15.2 on Mac OS Monterey.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions