1
1
mirror of https://github.com/c8r/x0.git synced 2024-08-17 01:10:32 +03:00

Show help with no arguments

This commit is contained in:
Brent Jackson 2018-06-22 18:50:15 -04:00
parent 0f3fb174af
commit 83a5f6c92f

5
cli.js
View File

@ -85,6 +85,11 @@ const cli = meow(`
})
const [ cmd, file ] = cli.input
if (!cmd) {
cli.showHelp(0)
}
const input = path.resolve(file || cmd)
const stats = fs.statSync(input)
const dirname = stats.isDirectory() ? input : path.dirname(input)