diff --git a/bin/marked b/bin/marked index 162ee7a5..f990dbf7 100755 --- a/bin/marked +++ b/bin/marked @@ -1,20 +1,25 @@ #!/usr/bin/env node /** - * Marked - * CLI + * Marked CLI + * Copyright (c) 2011, Christopher Jeffrey (MIT License) */ var fs = require('fs') , marked = require('../'); var usage = function() { + console.log(''); console.log('Usage:'); + console.log(' marked [-oih] [output] [input]'); console.log(''); - console.log(''); - console.log(''); - console.log(''); - console.log(''); + console.log('Options:'); + console.log(' -o, --output: Specify output file. If none is'); + console.log(' specified, write to stdout.'); + console.log(' -i, --input: Specify input file, otherwise use last'); + console.log(' argument as input file. If no input'); + console.log(' file is specified, read from stdin.'); + console.log(' -h, --help: Display this message.'); console.log(''); process.exit(0); }; @@ -26,7 +31,7 @@ var main = function(argv) { , arg , data; - var getarg = function(a) { + var getarg = function() { var arg = argv.shift(); arg = arg.split('='); if (/^['"]/.test(arg[0])) arg[0] = arg[0].slice(1, -1); @@ -48,7 +53,8 @@ var main = function(argv) { break; case '-i': case '--input': - input = arg; + //input = argv.shift(); + input = getarg(); break; case '--gfm': console.log('Implement me!');