Commit Graph

7 Commits

Author SHA1 Message Date
Justin Shreve 71d3308401 Show a reminder to include a valid --user flag when an authentication error is returned by the CLI.
Adds an additional message when the REST API returns 401 errors to the CLI, so that people properly include the `--user` flag.

To test:
* Run a command without a valid user ID (`wp wc product list`).
* See the additional error message.
* Run a command with a valid user ID, but cause another error, like a product not existing. (`wp wc product get 124124124 --user=1`).
* See that the extra error message is not displayed.
2017-03-06 11:34:06 -08:00
Justin Shreve dc501dc3be Fix CLI notice when using --fields.
A non-existent variable was being passed to `limit_item_to_fields`, causing a PHP notice to be displayed.
`PHP Notice:  Undefined variable: fields in includes/cli/class-wc-cli-rest-command.php on line 183`

This PR passes the correct value.

To Test:

1. Use `wp wc product list --user=1 --fields="sku,name"` on the command-line.
2. Make sure that a PHP notice does not display in your debug log.
2017-03-03 08:55:22 -08:00
Justin Shreve e8754eafcb Fix the PHP notice that is displaying when running commands like shop_coupon list that accept no ID arguments. 2017-03-01 13:22:02 -08:00
Justin Shreve 309d118287 Restructure ID route code for the CLI & make the attribute term command work. 2017-02-09 10:29:24 -08:00
Claudio Sanches 0da2f70e13 Fixed coding standards 2016-12-15 15:11:08 -02:00
Justin Shreve ec30c308c3 Add CLI tests 2016-12-08 14:13:10 -08:00
Justin Shreve da1e14c087 Add WC CLI commands powered by the REST API. 2016-12-08 10:59:07 -08:00