Skip to content

Commit

Permalink
Use commander instead of optimist for CLI arguments (palantir#2689)
Browse files Browse the repository at this point in the history
  • Loading branch information
andy-hanson authored and adidahiya committed May 25, 2017
1 parent 8b0ef1e commit 2bc8982
Show file tree
Hide file tree
Showing 5 changed files with 211 additions and 231 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
"dependencies": {
"babel-code-frame": "^6.22.0",
"colors": "^1.1.2",
"commander": "^2.9.0",
"diff": "^3.2.0",
"glob": "^7.1.1",
"optimist": "~0.6.0",
"resolve": "^1.3.2",
"semver": "^5.3.0",
"tslib": "^1.7.1",
Expand All @@ -53,12 +53,12 @@
"@types/babel-code-frame": "^6.20.0",
"@types/chai": "^3.5.0",
"@types/colors": "^1.1.3",
"@types/commander": "^2.9.0",
"@types/diff": "^3.2.0",
"@types/glob": "^5.0.30",
"@types/js-yaml": "^3.5.29",
"@types/mocha": "^2.2.35",
"@types/node": "^7.0.16",
"@types/optimist": "^0.0.29",
"@types/resolve": "^0.0.4",
"@types/semver": "^5.3.30",
"chai": "^3.5.0",
Expand Down
10 changes: 0 additions & 10 deletions src/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,6 @@ export interface IRunnerOptions {
* Whether to enable type checking when linting a project.
*/
typeCheck?: boolean;

/**
* Whether to show the current TSLint version.
*/
version?: boolean;
}

export class Runner {
Expand All @@ -118,11 +113,6 @@ export class Runner {
constructor(private options: IRunnerOptions, private outputStream: NodeJS.WritableStream) { }

public run(onComplete: (status: number) => void) {
if (this.options.version) {
this.outputStream.write(Linter.VERSION + "\n");
return onComplete(0);
}

if (this.options.init) {
if (fs.existsSync(CONFIG_FILENAME)) {
console.error(`Cannot generate ${CONFIG_FILENAME}: file already exists`);
Expand Down
Loading

0 comments on commit 2bc8982

Please sign in to comment.