Permalink
Browse files

last bits of usage

  • Loading branch information...
1 parent 810e92c commit d45519888d2996705a2780066abedb42bbb42118 @drewfish committed Apr 9, 2012
Showing with 28 additions and 8 deletions.
  1. +14 −7 lib/crank.js
  2. +14 −1 lib/op-changelog.js
View
@@ -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');
};
@@ -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;
@@ -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;
}
View
@@ -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');
};
@@ -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

0 comments on commit d455198

Please sign in to comment.