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

Commit

Permalink
1.1.0 (#35)
Browse files Browse the repository at this point in the history
##### New

* `wpcheck [-v | --version]` to print `wpcheck` version
  • Loading branch information
sergejmueller authored Nov 3, 2016
1 parent 05b0f70 commit 3f22333
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 2 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# wpcheck / CHANGELOG


### 1.1.0 (2016-11-03)

##### New

* `wpcheck [-v | --version]` to print `wpcheck` version


### 1.0.0 (2016-11-02)

##### New
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ Option | Shortcut | Description
------ | -------- | -----------
`--help` | `-h` | Outputs supplied help text.
`--silent` | `-s` | Disables success and info messages. Displays warnings only.
`--version` | `-v` | Prints `wpcheck` version.
`--rules-dir` | `-r` | Loads additional rules from a directory (see [Custom rules](#custom-rules)).
`--bulk-file` | `-b` | Reads additional WordPress site URLs from a text file (see [Bulk scan](#bulk-scan)).
`--ignore-rule` | `-i` | Skips loading and execution of a specific rule (see [Ignore rules](#ignore-rules)).
Expand Down
1 change: 1 addition & 0 deletions config/help.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"-b, --bulk-file Read and scan additional URLs from a text file",
"-u, --user-agent Define a custom User-Agent string",
"-i, --ignore-rule Skip loading and execution of a specific rule",
"-v, --version Print wpcheck version",
"-h, --help Show this help"
]
}
5 changes: 4 additions & 1 deletion config/minimist.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"alias": {
"h": "help",
"s": "silent",
"v": "version",
"r": "rules-dir",
"b": "bulk-file",
"u": "user-agent",
Expand All @@ -10,6 +11,7 @@
"default": {
"help": false,
"silent": false,
"version": false,
"rules-dir": null,
"bulk-file": null,
"user-agent": "wpcheck",
Expand All @@ -23,6 +25,7 @@
],
"boolean": [
"help",
"silent"
"silent",
"version"
]
}
5 changes: 5 additions & 0 deletions lib/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ const config = require( '../config/app.json' )

module.exports.wpcheck = ( data ) => {

// App version
if ( data.v ) {
return require( './version' )
}

// App help
if ( data.h ) {
return require( './help' )
Expand Down
9 changes: 9 additions & 0 deletions lib/version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

/**
* Required module
*/

const pkg = require( '../package.json' )


console.log( pkg.version )
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wpcheck",
"version": "1.0.0",
"version": "1.1.0",
"description": "Vulnerability scanner for WordPress",
"preferGlobal": true,
"main": "index.js",
Expand Down
20 changes: 20 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ describe( 'wpcheck CLI', () => {
data.must.include( '-b, --bulk-file Read and scan additional URLs from a text file' )
data.must.include( '-u, --user-agent Define a custom User-Agent string' )
data.must.include( '-i, --ignore-rule Skip loading and execution of a specific rule' )
data.must.include( '-v, --version Print wpcheck version' )
data.must.include( '-h, --help Show this help' )

done()
Expand All @@ -362,4 +363,23 @@ describe( 'wpcheck CLI', () => {

} )


/**
* wpcheck version
*/

it( `17. wpcheck --version`, ( done ) => {

exec( `wpcheck --version` ).then( result => {

const data = result.stdout.trim()

data.must.equal( require( '../package.json' ).version )

done()

} )

} )

} )

0 comments on commit 3f22333

Please sign in to comment.