File tree 1 file changed +11
-4
lines changed
1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -9,12 +9,13 @@ const { URL } = require('url');
9
9
10
10
const internals = { } ;
11
11
12
+ internals . help = ( ) => {
12
13
13
- internals . autoDetect = ( what ) => {
14
+ return `Usage: detect-node-support [ path | Github URL | npm package name ]` ;
15
+ } ;
14
16
15
- if ( ! what ) {
16
- return NodeSupport . detect ( { path : '.' } ) ;
17
- }
17
+
18
+ internals . autoDetect = ( what ) => {
18
19
19
20
try {
20
21
var url = new URL ( what ) ;
@@ -42,6 +43,11 @@ internals.autoDetect = (what) => {
42
43
43
44
exports . main = async ( nodeBin , thisBin , what ) => {
44
45
46
+ if ( ! what ) {
47
+ console . log ( internals . help ( ) ) ;
48
+ return ;
49
+ }
50
+
45
51
const result = await internals . autoDetect ( what ) ;
46
52
47
53
console . log ( result ) ;
@@ -51,5 +57,6 @@ exports.main(...process.argv)
51
57
. catch ( ( err ) => {
52
58
53
59
console . error ( err ) ;
60
+ console . log ( internals . help ( ) ) ;
54
61
process . exit ( 1 ) ;
55
62
} ) ;
You can’t perform that action at this time.
0 commit comments