-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: move cli to bin directory (#1096)
- Loading branch information
1 parent
5978350
commit e3ea11a
Showing
3 changed files
with
25 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env node | ||
'use strict' | ||
|
||
/* | ||
* Copyright (c) 2015-2015 MQTT.js contributors. | ||
* Copyright (c) 2011-2014 Adam Rudd. | ||
* | ||
* See LICENSE for more information | ||
*/ | ||
|
||
var commist = require('commist')() | ||
var helpMe = require('help-me')() | ||
|
||
commist.register('publish', require('./bin/pub')) | ||
commist.register('subscribe', require('./bin/sub')) | ||
commist.register('version', function () { | ||
console.log('MQTT.js version:', require('./package.json').version) | ||
}) | ||
commist.register('help', helpMe.toStdout) | ||
|
||
if (commist.parse(process.argv.slice(2)) !== null) { | ||
console.log('No such command:', process.argv[2], '\n') | ||
helpMe.toStdout() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters