summaryrefslogtreecommitdiffstats
path: root/bin/gitbook.js
diff options
context:
space:
mode:
authorAaron O'Mullan <aaron.omullan@gmail.com>2014-04-21 14:26:09 -0700
committerAaron O'Mullan <aaron.omullan@gmail.com>2014-04-21 14:26:09 -0700
commit4c90fdb7b27fdf6527b59097d489a9df0a929264 (patch)
treeb00f3196f58ed712dea40dd69a261fc43129a651 /bin/gitbook.js
parentd1c1d7b75b6e4a304d031c4313cf54ae8aa3a11d (diff)
parent98c133df3c9077c1b06748c3206bea3ff011ed3a (diff)
downloadgitbook-4c90fdb7b27fdf6527b59097d489a9df0a929264.zip
gitbook-4c90fdb7b27fdf6527b59097d489a9df0a929264.tar.gz
gitbook-4c90fdb7b27fdf6527b59097d489a9df0a929264.tar.bz2
Merge pull request #123 from GitbookIO/feature/plugins
Fix #65: Plugins Architecture
Diffstat (limited to 'bin/gitbook.js')
-rwxr-xr-xbin/gitbook.js19
1 files changed, 4 insertions, 15 deletions
diff --git a/bin/gitbook.js b/bin/gitbook.js
index f46d4d1..88ba5e2 100755
--- a/bin/gitbook.js
+++ b/bin/gitbook.js
@@ -17,22 +17,11 @@ var build = require('./build');
prog
.version(pkg.version);
-var buildCommand = function(command) {
- return command
- .option('-o, --output <directory>', 'Path to output directory, defaults to ./_book')
- .option('-f, --format <name>', 'Change generation format, defaults to site, availables are: '+_.keys(generators).join(", "))
- .option('-t, --title <name>', 'Name of the book to generate, default is extracted from readme')
- .option('-i, --intro <intro>', 'Description of the book to generate, default is extracted from readme')
- .option('-g, --github <repo_path>', 'ID of github repo like : username/repo')
- .option('--githubHost <url>', 'The url of the github host (defaults to https://github.com/')
- .option('--theme <path>', 'Path to theme directory');
-};
-
-buildCommand(prog.command('build [source_dir]'))
+build.command(prog.command('build [source_dir]'))
.description('Build a gitbook from a directory')
.action(build.folder);
-buildCommand(prog.command('serve [source_dir]'))
+build.command(prog.command('serve [source_dir]'))
.description('Build then serve a gitbook from a directory')
.option('-p, --port <port>', 'Port for server to listen on', 4000)
.action(function(dir, options) {
@@ -50,7 +39,7 @@ buildCommand(prog.command('serve [source_dir]'))
});
});
-buildCommand(prog.command('pdf [source_dir]'))
+build.command(prog.command('pdf [source_dir]'))
.description('Build a gitbook as a PDF')
.option('-pf, --paperformat <format>', 'PDF paper format (default is A4): "5in*7.5in", "10cm*20cm", "A4", "Letter"')
.action(function(dir, options) {
@@ -60,7 +49,7 @@ buildCommand(prog.command('pdf [source_dir]'))
}));
});
-buildCommand(prog.command('ebook [source_dir]'))
+build.command(prog.command('ebook [source_dir]'))
.description('Build a gitbook as a eBook')
.option('-c, --cover <path>', 'Cover image, default is cover.png if exists')
.action(function(dir, options) {