Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Improve CLI error message when no files are specified #3066

Merged
merged 2 commits into from
Jul 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/tslint-cli.ts
Expand Up @@ -232,7 +232,7 @@ if (parsed.unknown.length !== 0) {
const argv = commander.opts() as any as Argv;

if (!(argv.init || argv.test !== undefined || argv.project !== undefined || commander.args.length > 0)) {
console.error("Missing files");
console.error("No files specified. Use --project to lint a project folder.");
process.exit(1);
}

Expand Down
4 changes: 3 additions & 1 deletion test/executable/executableTests.ts
Expand Up @@ -37,7 +37,9 @@ describe("Executable", function(this: Mocha.ISuiteCallbackContext) {
assert.isNotNull(err, "process should exit with error");
assert.strictEqual(err.code, 1, "error code should be 1");

assert.include(stderr, "Missing files", "stderr should contain notification about missing files");
assert.include(stderr,
"No files specified. Use --project to lint a project folder.",
"stderr should contain notification about missing files");
assert.strictEqual(stdout, "", "shouldn't contain any output in stdout");
done();
});
Expand Down