mirror of
https://github.com/c8r/x0.git
synced 2024-09-11 13:45:52 +03:00
Show help with no arguments
This commit is contained in:
parent
0f3fb174af
commit
83a5f6c92f
5
cli.js
5
cli.js
@ -85,6 +85,11 @@ const cli = meow(`
|
|||||||
})
|
})
|
||||||
|
|
||||||
const [ cmd, file ] = cli.input
|
const [ cmd, file ] = cli.input
|
||||||
|
|
||||||
|
if (!cmd) {
|
||||||
|
cli.showHelp(0)
|
||||||
|
}
|
||||||
|
|
||||||
const input = path.resolve(file || cmd)
|
const input = path.resolve(file || cmd)
|
||||||
const stats = fs.statSync(input)
|
const stats = fs.statSync(input)
|
||||||
const dirname = stats.isDirectory() ? input : path.dirname(input)
|
const dirname = stats.isDirectory() ? input : path.dirname(input)
|
||||||
|
Loading…
Reference in New Issue
Block a user