jacobdeichert / mask

🎭 A CLI task runner defined by a simple markdown file
MIT License
1.11k stars 55 forks source link

Don't add a command for a heading that has no code blocks #65

Closed jacobdeichert closed 4 years ago

jacobdeichert commented 4 years ago

When a heading has no code blocks AND its child headings have no code blocks, then we shouldn't create a command for it.

Example:

# MY COMMANDS

## Docs

Just some documentation.

## cmd
~~~bash
echo something
~~~

Current Behaviour

mask -h

mask 0.8.0

USAGE:
    mask [OPTIONS] <SUBCOMMAND>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
        --maskfile <maskfile>    Path to a different maskfile you want to use

SUBCOMMANDS:
    Docs        
    cmd

Desired Behaviour

mask -h

mask 0.8.0

USAGE:
    mask [OPTIONS] <SUBCOMMAND>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
        --maskfile <maskfile>    Path to a different maskfile you want to use

SUBCOMMANDS:
    cmd