gitbook-cli
Advanced tools
Comparing version
var _ = require('lodash'); | ||
// Helper function for print help | ||
// indented output by spaces | ||
function indent_output(n, name, description) { | ||
if (!n) { | ||
n = 0; | ||
} | ||
console.log( | ||
_.repeat(' ', n) | ||
+ name | ||
+ _.repeat(' ', 32 - n * 4 - name.length) | ||
+ description | ||
); | ||
} | ||
// Print help for a list of commands | ||
@@ -7,3 +22,3 @@ // It prints the command and its description, then all the options | ||
_.each(commands, function(command) { | ||
console.log(' '+command.name, '\t', command.description); | ||
indent_output(1, command.name, command.description); | ||
_.each(command.options || [], function(option) { | ||
@@ -18,3 +33,6 @@ var after = []; | ||
console.log(' --'+option.name, '\t', option.description, after); | ||
var optname = '--'; | ||
if (typeof option.defaults === 'boolean') optname += '[no-]'; | ||
optname += option.name; | ||
indent_output(2, optname, option.description + ' ' + after); | ||
}); | ||
@@ -21,0 +39,0 @@ console.log(''); |
{ | ||
"name": "gitbook-cli", | ||
"version": "2.1.3", | ||
"version": "2.2.0", | ||
"homepage": "https://www.gitbook.com", | ||
@@ -16,3 +16,3 @@ "description": "CLI to generate books and documentation using gitbook", | ||
"fs-extra": "0.26.5", | ||
"bash-color": "0.0.3", | ||
"bash-color": "0.0.4", | ||
"npm": "3.7.5", | ||
@@ -19,0 +19,0 @@ "user-home": "2.0.0" |
@@ -27,4 +27,2 @@ # gitbook-cli | ||
#### Build and Serve | ||
### Run GitBook | ||
@@ -95,7 +93,1 @@ | ||
### Resolve | ||
- Look for the `book.json` and use `gitbook` field to resolve versions to use | ||
- Use latest version installed locally | ||
- `3.0.0-pre.1` will be used in favor of `2.6.7` by default | ||
- Tags `pre`, `alpha`, `beta`, `latest` will always be used first |
@@ -7,3 +7,3 @@ var path = require('path'); | ||
describe('Versions', function() { | ||
this.timeout(50000); | ||
this.timeout(100000); | ||
@@ -10,0 +10,0 @@ describe('.available()', function() { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
31273
0.29%775
2.11%92
-8%+ Added
- Removed
Updated