ept / avrodoc

Documentation tool for Avro schemas
Apache License 2.0
148 stars 82 forks source link

Command-line argument for output file #4

Closed ept closed 11 years ago

ept commented 11 years ago

For situations where you can't redirect stdout (e.g. some CI servers), we should support writing the HTML output to a file specified on the command line.

I think sort(1) is a good example for command line style. In its style, we would support all these forms (argument order doesn't matter, so the output argument can come before or after the inputs):

$ avrodoc input1.avsc input2.avsc > output.html
$ avrodoc input1.avsc input2.avsc -o output.html
$ avrodoc input1.avsc input2.avsc --output output.html
$ avrodoc input1.avsc input2.avsc --output=output.html
$ avrodoc -o output.html -- -input-file-that-starts-with-a-hyphen.avsc
ept commented 11 years ago

See this thread on node.js command-line argument parsers.

mphuff commented 11 years ago

This seems like by far the most flexible offering and is exactly I think what we're after: https://github.com/substack/node-optimist

I'm hoping that I'll get to this this week but likely at latest early next week. That is unless you beat me to it.

Micah

mphuff commented 11 years ago

Glad to see this got pulled in so quickly! Let me know when you get a chance to get this out to the npmjs site.

Thank you for all of your help Martin!

Micah

ept commented 11 years ago

Fixed in #8, thanks Micah :)