Skip to content
crmckenzie edited this page Jan 4, 2016 · 2 revisions

The built-in HelpWriter implementation will generate help documentation for your command tree.

The DefaultHelpWriter organizes help content in the following way:

Identifier => Spacer => Description

Indentation => Identifier => Spacer => Description

The measurements used by default are:

Element Width
Identifier 20
Spacer 4
Indentation 4
Description 52

This results in a total content width of 80 characters. The Identifier width is reduced by the width of Indentation on indented rows. Description lengths greater than 52 characters will be paginated across multiple rows.

Overriding DefaultHelpWriter Output

These values are overridable in the following way:

var cmd = new MyCustomCommand()
   .Use(new DefaultHelpWriter(){
     Identifier = 30,
     Spacer = 6,
     Indentation = 6,
     Description = 60
     })
   ;

int result = cmd.Execute(args);
Environment.Exit(result);

Replacing the DefaultHelpWriter

var cmd = new MyCustomCommand()
   .Use(new MyCustomHelpWriter())
   ;

int result = cmd.Execute(args);
Environment.Exit(result);
Clone this wiki locally