Tyrrrz/CliFx

Replace the command section in help text with the current subcommand usage examples

Tyrrrz opened this issue · 4 comments

Currently, the help text looks like this:

DiscordChatExporter.Cli v2.23.0

Usage
  dotnet DiscordChatExporter.Cli.dll [command] [options]

  ... exportall --token <value> [options]
  ... export --channel <value> --token <value> [options]
  ... exportdm --token <value> [options]
  ... exportguild --guild <value> --token <value> [options]
  ... channels --guild <value> --token <value> [options]
  ... dm --token <value> [options]
  ... guilds --token <value> [options]
  ... guide [options]

Options
  -h|--help         Shows help text.
  --version         Shows version information.

Commands
  exportall         Export all accessible channels.
  export            Export a channel.
  exportdm          Export all direct message channels.
  exportguild       Export all channels within specified guild.
  channels          Get the list of channels in a guild.
  dm                Get the list of direct message channels.
  guilds            Get the list of accessible guilds.
  guide             Explains how to obtain token, guild or channel ID.

You can run `dotnet DiscordChatExporter.Cli.dll [command] --help` to show help on a specific command.

This is a bit suboptimal, for few reasons:

  1. Command names are duplicated
  2. Command usage info and description are separated
  3. The help text is too long

The suggestion is to change the help text to this instead:

DiscordChatExporter.Cli v2.23.0

Usage
  dotnet DiscordChatExporter.Cli.dll [command] [options]

Options
  -h|--help         Shows help text.
  --version         Shows version information.

Commands
  Export all acessible channels
    exportall --token <value>
  Export a channel
    export --channel <value> --token <value>
  Export all direct message channels
    exportdm --token <value>
  Export all channels within specified guild  
    exportguild --guild <value> --token <value>
  Get the list of channels in a guild
    channels --guild <value> --token <value>
  Get the list of direct message channels
     dm --token <value>
  Get the list of accessible guilds
     guilds --token <value>
  Explains how to obtain token, guild or channel ID
     guide

You can run `dotnet DiscordChatExporter.Cli.dll [command] --help` to show help on a specific command.

Vertical formatting instead of columns because command usage info can get rather large. Generally, the format is up to discussion, so ideas are welcome.

Hello @Tyrrrz awesome project! I would like to suggest regarding the format, that instead of following an alignment in which the description is above the command and usage, to show the description on the right side in the same row while still including the command and usage on the left side in the same row, e.g. VS Code CLI
image

I would like to know if you would prefer this approach?

Hi @es-rene99
The problem is your screenshot shows option descriptions, which are fairly constrained in size. In our case it's a full command usage example which may include many parameters or required options. I would prefer to have two columns, but we can't guarantee that it will actually fit.

I see, yes you're right, in that case I can take a look with the format you proposed, could you please assign me this task?

Sure. Feel free to experiment with the format as much as you wish. Ideally we want to have as little vertical space usage as possible, so that most help text fits on one screen.