#!/usr/bin/env node

/*!
 * thoughtful-release <https://github.com/nknapp/thoughtful-release>
 *
 * Copyright (c) 2015 Nils Knappmeier.
 * Released under the MIT license.
 */

'use strict'

var program = require('commander')

program
  .version(require('../package').version)
  .command('changelog <release>', 'update the CHANGELOG.md of the module in the current directory')
  .option('<release>', 'The target release of the changelog (same as for "npm version")')
  .action((release) => {
    console.log('Updating changelog')
    require('../index.js').updateChangelog(process.cwd(), release).done(console.log)
  })

program.parse(process.argv)

#!/usr/bin/env node

/*!
 * thoughtful-release <https://github.com/nknapp/thoughtful-release>
 *
 * Copyright (c) 2015 Nils Knappmeier.
 * Released under the MIT license.
 */

'use strict'

var program = require('commander')

program
  .version(require('../package').version)
  .command('changelog <release>')
  .description('update the CHANGELOG.md of the module in the current directory')
  .option('<release>', 'The target release of the changelog (same as for "npm version")')
  .action((release) => {
    console.log('Updating changelog')
    require('../index.js').updateChangelog(process.cwd(), release).done(console.log)
  })

program.parse(process.argv)

if (process.argv.length === 2) {
  // No args provided: Display help
  program.outputHelp()
}

Correct use of `commander` for parsing CLI options
[Fix] Correct use of `commander` for parsing CLI options

- `changelog` is not a "git-style-subcommand"
- output help if no parameters are provided
