Skip to content

Commit

Permalink
feat(cli): add -V, --version cmd line arg
Browse files Browse the repository at this point in the history
Display version string and exit when -V or --version command line
arguments are supplied.

Issue #149
  • Loading branch information
tcort committed May 26, 2021
1 parent 5439fc7 commit 10389d0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ Options:
-a, --alive <code> comma separated list of HTTP code to be considered as alive
-r, --retry retry after the duration indicated in 'retry-after' header when HTTP code is 429
-h, --help display help for command
-V, --version display version string (e.g. `1.2.3`)
```

##### Config file format
Expand Down
2 changes: 2 additions & 0 deletions markdown-link-check
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const program = require('commander');
const request = require('request');
const url = require('url');
const path = require('path');
const pkg = require('./package.json');

const statusLabels = {
alive: chalk.green('✓'),
Expand All @@ -28,6 +29,7 @@ function commaSeparatedCodesList(value, dummyPrevious) {
}

program
.version(pkg.version)
.option('-p, --progress', 'show progress bar')
.option('-c, --config [config]', 'apply a config file (JSON), holding e.g. url specific header configuration')
.option('-q, --quiet', 'displays errors only')
Expand Down

0 comments on commit 10389d0

Please sign in to comment.