Skip to content

Commit

Permalink
add test command and version
Browse files Browse the repository at this point in the history
  • Loading branch information
mircobabini committed Aug 24, 2021
1 parent d3f1623 commit cebe331
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

## Supported commands

* `wp swim to-www` -- Rende un sito accessibile tramite www.
* `wp swim to-www` -- Make the website accessible via www.
* `wp swim to-https` -- Make the website accessible via https.

## Work in progress commands

* `wp swim to-https` -- Rende un sito accessibile tramite https.
* `wp swim autoperm` -- ...
* `wp swim update-all` -- ...
* `wp swim cache-clean` -- ...

## Installing

`wp package install git@github.com:sedwebagency/swim-wp-cli.git`
`wp package install https://github.com/sedwebagency/swim-wp-cli/releases/latest/download/swim-wp-cli.zip`

## Thanks to

Expand Down
18 changes: 18 additions & 0 deletions command.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,24 @@
use function WP_CLI\Utils\make_progress_bar;

class Swim_WP_CLI extends WP_CLI_Command {
// todo move the version to the "package meta" docblock
const VERSION = '1.0.1';

/**
* A test which always gives success and the current version.
*
* ## EXAMPLES
*
* wp swim test
*
* @subcommand test
*/
public function test( array $args = [], array $assoc_args = [] ) {
$current_version = self::VERSION;

WP_CLI::success( "Success. Installed version $current_version." );
}

/**
* Make the website accessible via www.
*
Expand Down

0 comments on commit cebe331

Please sign in to comment.