Skip to content

Commit 0f8cc0e

Browse files
committed
Simplify CLI snippet
1 parent 1665305 commit 0f8cc0e

File tree

1 file changed

+9
-15
lines changed
  • tools/snippets/bin

1 file changed

+9
-15
lines changed

tools/snippets/bin/cli

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ var parseArgs = require( 'minimist' );
99
var notifier = require( 'update-notifier' );
1010
var pkg = require( './../package.json' );
1111
var opts = require( './opts.json' );
12-
var TODO = require( './../lib' );
12+
var main = require( './../lib' );
1313

1414

1515
// FUNCTIONS //
@@ -53,19 +53,16 @@ function version() {
5353
var args;
5454

5555

56-
// INIT //
57-
58-
process.title = pkg.name;
59-
process.stdout.on( 'error', process.exit );
60-
61-
62-
// PACKAGE UPDATES //
56+
// MAIN //
6357

58+
// Check if newer versions exist for this package:
6459
notifier( { 'pkg': pkg } ).notify();
6560

61+
// Set the process title to allow the process to be more easily identified:
62+
process.title = pkg.name;
63+
process.stdout.on( 'error', process.exit );
6664

67-
// ARGUMENTS //
68-
65+
// Parse command-line arguments:
6966
args = parseArgs( process.argv.slice( 2 ), opts );
7067

7168
if ( args.help ) {
@@ -75,8 +72,5 @@ if ( args.version ) {
7572
return version();
7673
}
7774

78-
79-
// MAIN //
80-
81-
// TODO: implementation
82-
TODO();
75+
// Run main:
76+
main(); // TODO: implementation

0 commit comments

Comments
 (0)