File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 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');
99
1010const internals = { } ;
1111
12+ internals . help = ( ) => {
1213
13- internals . autoDetect = ( what ) => {
14+ return `Usage: detect-node-support [ path | Github URL | npm package name ]` ;
15+ } ;
1416
15- if ( ! what ) {
16- return NodeSupport . detect ( { path : '.' } ) ;
17- }
17+
18+ internals . autoDetect = ( what ) => {
1819
1920 try {
2021 var url = new URL ( what ) ;
@@ -42,6 +43,11 @@ internals.autoDetect = (what) => {
4243
4344exports . main = async ( nodeBin , thisBin , what ) => {
4445
46+ if ( ! what ) {
47+ console . log ( internals . help ( ) ) ;
48+ return ;
49+ }
50+
4551 const result = await internals . autoDetect ( what ) ;
4652
4753 console . log ( result ) ;
@@ -51,5 +57,6 @@ exports.main(...process.argv)
5157 . catch ( ( err ) => {
5258
5359 console . error ( err ) ;
60+ console . log ( internals . help ( ) ) ;
5461 process . exit ( 1 ) ;
5562 } ) ;
You can’t perform that action at this time.
0 commit comments