question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`-h` of Subcommand does not print full information

See original GitHub issue

Version: 0.3.0

I have command:

class Test: Subcommand("test") {
    val input by argument(ArgType.String, "This text will be written")

    override fun execute() { }
}

If I run with the arguments test -h, it prints very little information like:

Usage: android-dev-tools test options_list

However, if I made a mistake, then it shows full documentation as error:

Usage: android-dev-tools test options_list
Arguments:
    This text will be written { String }
Options:
    --help, -h -> Usage info

        at kotlinx.cli.ArgParser.printError(ArgParser.kt:348)
        at kotlinx.cli.ArgParser.parse(ArgParser.kt:635)
        at kotlinx.cli.ArgParser.parse(ArgParser.kt:640)
        at kotlinx.cli.ArgParser.parse(ArgParser.kt:521)
        at com.vinted.devtools.android.AppKt.main(App.kt:14)

Reproduction: problem.zip

An easiest way to reproduce:

./gradlew run --args="test -h" // I am expecting full help here
./gradlew run --args="test"     // works as expected

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
LepilkinaElenacommented, Oct 21, 2020

Fixing this problem PR is already waiting review.

0reactions
LepilkinaElenacommented, Nov 24, 2020

0.3.1 version with fix was published

Read more comments on GitHub >

github_iconTop Results From Across the Web

CommandLine.usage on subcommand does not properly ...
CommandLine.usage on subcommand does not properly display command ... In that case, it doesn't print any information about the subcommands.
Read more >
Subcommands - IBM
Note: Not all printers can print in all directions. See your printer documentation for more information. SUPPRESSION. Read syntax diagram Skip visual syntax ......
Read more >
App in clap - Rust - Docs.rs
Used to create a representation of a command line program and all possible command line arguments. Application settings are set using the “builder...
Read more >
Tutorial: Get started with System.CommandLine
Learn how to use the System.CommandLine library for command-line apps.
Read more >
Command-Line Usage of uap — uap 0.1.1 documentation
Therefore, uap provides help information on the command-line: $ uap -h usage: ... Subcommands¶. Here an overview of all the available subcommands are...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found