You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For all WP-CLI commands, arguments following a long switch are interpreted as positional without =:
$ wp user list --role admin
Error: Too many positional arguments: admin
$ wp user list --role=admin
+----+------------+--------------+------------+-----------------+-------+
| ID | user_login | display_name | user_email | user_registered | roles |
+----+------------+--------------+------------+-----------------+-------+
+----+------------+--------------+------------+-----------------+-------+
This is unhandy, but acceptable.
However, it becomes a real usablity issue when calling WP-CLI programmatically.
In my case, Python's subprocess.run is used to call WP-CLI (with shell=False for obvious security reasons).
As a result, I have to do this:
command.append(f"--path={self.path}")
... instead of:
command.extend(["--path", self.path])
This way of working delegates string interpolation - and sometimes even quoting - to the caller, which is not developer-friendly (and probably not very POSIX-y).
The text was updated successfully, but these errors were encountered:
For all WP-CLI commands, arguments following a long switch are interpreted as positional without
=
:This is unhandy, but acceptable.
However, it becomes a real usablity issue when calling WP-CLI programmatically.
In my case, Python's
subprocess.run
is used to call WP-CLI (withshell=False
for obvious security reasons).As a result, I have to do this:
... instead of:
This way of working delegates string interpolation - and sometimes even quoting - to the caller, which is not developer-friendly (and probably not very POSIX-y).
The text was updated successfully, but these errors were encountered: