Closed derekr closed 3 years ago
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.
I just use block comments:
#!/usr/bin/env node
/*
# Usage: diy notify
# Summary: Send a notification to any maker.
# Help: Be careful!
*/
This can be closed. The suggestion by @iakobos is simple, intuitive and works.
👁️ Catching up here after a long time off... I'd love a PR to allow for parsing comments in different languages. Can close this for now though.
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:
and