# CommandHelp
<span class="source-link">[[Source]](src/cli/command_help.md#L37)</span>

CommandHelp encapsulates the information needed to generate a user help
message for a given CommandSpec, optionally with a specific command
identified to print help about. Use `Help.general()` or `Help.for_command()`
to create a CommandHelp instance.


```pony
class box CommandHelp
```

## Constructors

### _create
<span class="source-link">[[Source]](src/cli/command_help.md#L47)</span>


```pony
new ref _create(
  parent': (CommandHelp box | None val),
  spec': CommandSpec box)
: CommandHelp ref^
```
#### Parameters

*   parent': ([CommandHelp](cli-CommandHelp) box | [None](builtin-None) val)
*   spec': [CommandSpec](cli-CommandSpec) box

#### Returns

* [CommandHelp](cli-CommandHelp) ref^

---

## Public Functions

### fullname
<span class="source-link">[[Source]](src/cli/command_help.md#L51)</span>


```pony
fun box fullname()
: String val
```

#### Returns

* [String](builtin-String) val

---

### string
<span class="source-link">[[Source]](src/cli/command_help.md#L58)</span>


```pony
fun box string()
: String val
```

#### Returns

* [String](builtin-String) val

---

### help_string
<span class="source-link">[[Source]](src/cli/command_help.md#L60)</span>


Renders the help message as a String.


```pony
fun box help_string()
: String val
```

#### Returns

* [String](builtin-String) val

---

### print_help
<span class="source-link">[[Source]](src/cli/command_help.md#L70)</span>


Prints the help message to an OutStream.


```pony
fun box print_help(
  os: OutStream tag)
: None val
```
#### Parameters

*   os: [OutStream](builtin-OutStream) tag

#### Returns

* [None](builtin-None) val

---

## Private Functions

### _write_help
<span class="source-link">[[Source]](src/cli/command_help.md#L78)</span>


```pony
fun box _write_help(
  w: Writer ref)
: None val
```
#### Parameters

*   w: [Writer](buffered-Writer) ref

#### Returns

* [None](builtin-None) val

---

### _write_usage
<span class="source-link">[[Source]](src/cli/command_help.md#L100)</span>


```pony
fun box _write_usage(
  w: Writer ref)
: None val
```
#### Parameters

*   w: [Writer](buffered-Writer) ref

#### Returns

* [None](builtin-None) val

---

### _write_options
<span class="source-link">[[Source]](src/cli/command_help.md#L117)</span>


```pony
fun box _write_options(
  w: Writer ref,
  options: Array[OptionSpec box] box)
: None val
```
#### Parameters

*   w: [Writer](buffered-Writer) ref
*   options: [Array](builtin-Array)\[[OptionSpec](cli-OptionSpec) box\] box

#### Returns

* [None](builtin-None) val

---

### _write_commands
<span class="source-link">[[Source]](src/cli/command_help.md#L124)</span>


```pony
fun box _write_commands(
  w: Writer ref)
: None val
```
#### Parameters

*   w: [Writer](buffered-Writer) ref

#### Returns

* [None](builtin-None) val

---

### _list_commands
<span class="source-link">[[Source]](src/cli/command_help.md#L129)</span>


```pony
fun box _list_commands(
  cs: CommandSpec box,
  cols: Array[(USize val , String val , String val)] ref,
  level: USize val)
: None val
```
#### Parameters

*   cs: [CommandSpec](cli-CommandSpec) box
*   cols: [Array](builtin-Array)\[([USize](builtin-USize) val , [String](builtin-String) val , [String](builtin-String) val)\] ref
*   level: [USize](builtin-USize) val

#### Returns

* [None](builtin-None) val

---

### _write_args
<span class="source-link">[[Source]](src/cli/command_help.md#L139)</span>


```pony
fun box _write_args(
  w: Writer ref,
  args: Array[ArgSpec val] box)
: None val
```
#### Parameters

*   w: [Writer](buffered-Writer) ref
*   args: [Array](builtin-Array)\[[ArgSpec](cli-ArgSpec) val\] box

#### Returns

* [None](builtin-None) val

---

### _any_options
<span class="source-link">[[Source]](src/cli/command_help.md#L146)</span>


```pony
fun box _any_options()
: Bool val
```

#### Returns

* [Bool](builtin-Bool) val

---

### _all_options
<span class="source-link">[[Source]](src/cli/command_help.md#L157)</span>


```pony
fun box _all_options()
: Array[OptionSpec box] ref
```

#### Returns

* [Array](builtin-Array)\[[OptionSpec](cli-OptionSpec) box\] ref

---

### _all_options_fill
<span class="source-link">[[Source]](src/cli/command_help.md#L162)</span>


```pony
fun box _all_options_fill(
  options: Array[OptionSpec box] ref)
: None val
```
#### Parameters

*   options: [Array](builtin-Array)\[[OptionSpec](cli-OptionSpec) box\] ref

#### Returns

* [None](builtin-None) val

---

