sigoden/argc

Multi-line documentation

CGamesPlay opened this issue · 1 comments

Hi, I was just looking for a better task runner than my previous choice, and I came across this project. I think it's very simple and elegant and would make a great choice for my scripts. However, one of the main things that I want is to include lots of documentation in the generated help messages, and there presently isn't a way to do that. What I'd like to see is some sort of "long description" field that gets printed in the usage message, applicable to both the top command and subcommands. The precise syntax doesn't really matter, but here is a proposal to consider:

# @description my sweet command
# Extra lines after the @description, which don't start with an @, are 
# treated as the long description. A line which is not a comment ends
# the block.

# @cmd Run subcommand
# Extra comments after the @cmd line, which don't start with an @, are
# treated as the long description. A line which is not a comment ends
# the block.
subcommand() { true; }

This long description would just be put in the command help:

my sweet command

USAGE: test <COMMAND>

COMMANDS:
  subcommand  Run subcommand

Extra lines after the @description, which don't start with an @, are 
treated as the long description. A line which is not a comment ends
the block.

Run subcommand

USAGE: test subcommand

Extra comments after the @cmd line, which don't start with an @, are
treated as the long description. A line which is not a comment ends
the block.

Thanks for your consideration!

Awesome! Thank you for implementing this! I'll definitely be porting over my command runners to use argc 🙂