Skip to content

Wrong Exit Status #1415

@MiteshShah

Description

@MiteshShah

WP-CLI Information:

PHP binary: /usr/bin/php5
PHP version:    5.5.17-1+deb.sury.org~precise+1
php.ini used:   /etc/php5/cli/php.ini
WP-CLI root dir:    phar://wp-cli.phar
WP-CLI global config:   
WP-CLI project config:  
WP-CLI version: 0.17.0

Issue:

wp --allow-root user update testuser --user_pass=1234567
Warning: Invalid user ID, email or login: 'testuser'

Seems good message but most of script check weather last command is successful or not using exit status

Lets check exit status:

echo $?
0

Its a good practice to change exit status when command failed to execute.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions