Skip to content

[Improvement] octocov badge help message don't show required subcommands #523

@umatare5

Description

@umatare5

Description

The help message for the octocov badge command doesn't list the required subcommands. As a result, users cannot know from the help output that coverage, ratio, and time are required.

❯ go run main.go badge --help
generate badge.

Usage:
  octocov badge [flags]

Flags:
      --config string   config file path
  -h, --help            help for badge
      --out string      output file path

Because of this, users often encounter the error Error: accepts 1 arg(s), received 0.

❯ go run main.go badge --config .octocov.yml
Error: accepts 1 arg(s), received 0
exit status 1

❯ go run main.go badge --out badge.svg
Error: accepts 1 arg(s), received 0
exit status 1

Cause

This is purely a cosmetic issue.

Proposal

To improve the command’s usability, I see two possible approaches: a simple fix and a more structural fix. Would you please share your thoughts on these options?

Simple fix

Add the required subcommands to the help output.

Structural fix

Follow the approach used for octocov complecation by defining subcommands through the cobra framework. However, my concern is that this would significantly increase the amount of code and might be excessive for the current implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions