Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-line documentation #97

Closed
CGamesPlay opened this issue Apr 26, 2023 · 1 comment · Fixed by #103
Closed

Multi-line documentation #97

CGamesPlay opened this issue Apr 26, 2023 · 1 comment · Fixed by #103

Comments

@CGamesPlay
Copy link
Contributor

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!

sigoden added a commit that referenced this issue May 18, 2023
sigoden added a commit that referenced this issue May 18, 2023
* feat: support multi-line doc

close #97

* update test
@CGamesPlay
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant