Skip to content

Commit

Permalink
last bits of usage
Browse files Browse the repository at this point in the history
  • Loading branch information
drewfish committed Apr 9, 2012
1 parent 810e92c commit d455198
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 8 deletions.
21 changes: 14 additions & 7 deletions lib/crank.js
Expand Up @@ -248,7 +248,13 @@ OPVersion.options = {};


OPVersion.prototype.usage = function(command) {
// TODO
console.log(
'USAGE: crank version {part}' +
'\n'+
'\n increments the version number in package.json' +
'\n {part} is `major`, `minor`, or `patch`.'+
'\n defaults to `patch`' +
'\n');
};


Expand Down Expand Up @@ -335,6 +341,7 @@ function usage(command) {
'GLOBAL OPTIONS\n' +
' --config {file} which config file to use\n' +
' (defaults to crank.json)\n' +
' --help {command} show help about a command\n' +
'\n' +
'COMMANDS');
max = 0;
Expand All @@ -358,16 +365,16 @@ function usage(command) {
function run(command) {
var base, ctor, op;

if (! command.op) {
this.usage(command);
if (command.globalOptions.help) {
command.op = command.globalOptions.help;
usage(command);
return;
}
if (command.error) {
this.usage(command);
if (! command.op) {
usage(command);
return;
}

if (command.globalOptions.help) {
if (command.error) {
usage(command);
return;
}
Expand Down
15 changes: 14 additions & 1 deletion lib/op-changelog.js
Expand Up @@ -54,7 +54,16 @@ OPChangelog.options = {};


OPChangelog.prototype.usage = function(command) {
// TODO
console.log(
'USAGE: crank changelog {file}' +
'\n'+
'\n updates the changelog in the file' +
'\n {file} is optional if it\'s specified in the crank.json config file' +
'\n' +
'\n The changelog is first read to which change (git commit or svn revision)' +
'\n has already been recorded there. Then all changes since then are found '+
'\n and added to the changelog, using the version number found in package.json.' +
'\n');
};


Expand All @@ -67,6 +76,10 @@ OPChangelog.prototype.run = function(command) {
latestVersion,
rendered = '';

if (command.args[0]) {
this.base.config.changelog.file = command.args.shift();
}

libasync.series([

// read db
Expand Down

0 comments on commit d455198

Please sign in to comment.