Auto Documenting Syntax For Node Commands #36

Open
derekr opened this Issue Mar 1, 2013 · 2 comments

Projects

None yet

3 participants

@derekr

Not quite sure how to tap in to the auto documentation when creating a node based command. Hash bangs are illegal characters and js comments aren't picked up by sub.

Tried:

#!/usr/bin/env node
// # Usage: diy notify
// # Summary: Send a notification to any maker.
// # Help: Be careful!

and

#!/usr/bin/env node
// Usage: diy notify
// Summary: Send a notification to any maker.
// Help: Be careful!
@jdevera

You can work around this by having a shell script to be the actual command (sub-something) with all the metadata and then just call

exec something.js "$@"

to call the node command. I do something similar for binary (compiled code) commands.

@jacobthemyth

I just use block comments:

#!/usr/bin/env node
/*
# Usage: diy notify
# Summary: Send a notification to any maker.
# Help: Be careful!
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment