Skip to content

Feature Request: Add Examples section in HelpBuilder. #2510

Open
@moh-hassan

Description

@moh-hassan

The current help is generated based on the Description of Command/Option or Argument.
Most of cli tools provide examples in help.
It is needed to add a separate section appended to the current generated help for every Command.
The Examples can be a string property (like Description) in CliCommand to be used in configuring help examples every command.

In the article Add or replace help sections, we can add a new section , but it need to access a property Eg Examples
It is nice of that ExampleSection be part of HelpBuilder class .
Sample of the help with examples:

Description:
  Read a file

Usage:
  scl [options]

Options:
  --file <file>                                               The file to print out. [default: scl.runtimeconfig.json]
  --light-mode                                                Determines whether the background color will be black or
                                                              white
  --color                                                     Specifies the foreground color of console output
  <Black|Blue|Cyan|White>
  --version                                                   Show version information
  -?, -h, --help                                              Show help and usage information
 
Examples:
Example 1: 
scl --file  file.txt --color Cyan
Example 2: Using default color  
scl --file  file.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions