Skip to content

Commit

Permalink
doc: Document nested subcommands
Browse files Browse the repository at this point in the history
  • Loading branch information
juanibiapina committed May 23, 2024
1 parent 7866742 commit 77e6896
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,39 @@ file. The special comments are:
- Extended documentation: Any other comment lines in this initial block will be
considered part of the extended documentation.

## Nested subcommands

`sub` supports nested directories for hierarchical command structures. For
example, given the following directory structure:

```
.
└── libexec
└── nested
β”œβ”€β”€ README
└── user-script2
```

`user-script2` can be invoked with:

```sh
$ hat nested user-script2
```

Directories can be nested arbitrarily deep.

A `README` file can be placed in a directory to provide a description of the
subcommands in that directory. The `README` file should be formatted like a
script, with a special comment block at the beginning:

```sh
# Summary: A collection of user scripts
#
# This directory contains scripts that do magic.
# This help can be as long as you want.
# The Usage comment is ignored in README files.
```

## Aliases

To define an alias, simply create a symlink. For example, in the `libexec`
Expand Down

0 comments on commit 77e6896

Please sign in to comment.