Skip to content

Commit 45c5d74

Browse files
swissspidyclaude
andauthored
Declare dash-separated aliases of user application-password list filters (#653)
Co-authored-by: Claude <noreply@anthropic.com>
1 parent fd471bb commit 45c5d74

1 file changed

Lines changed: 6 additions & 15 deletions

File tree

‎src/User_Application_Password_Command.php‎

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ final class User_Application_Password_Command {
8484
* [--uuid=<uuid>]
8585
* : Filter by the universally unique ID of the application password.
8686
*
87-
* [--app_id=<app_id>]
88-
* : Filter by the application ID. `--app-id` is also accepted.
87+
* [--app_id=<app_id>|app-id]
88+
* : Filter by the application ID. `--app-id` is accepted as an alias.
8989
*
9090
* [--name=<name>]
9191
* : Filter by the name of the application password.
@@ -96,13 +96,13 @@ final class User_Application_Password_Command {
9696
* [--created=<created>]
9797
* : Filter by the Unix timestamp the application password was created at.
9898
*
99-
* [--last_used=<last_used>]
99+
* [--last_used=<last_used>|last-used]
100100
* : Filter by the Unix timestamp the application password was last used at.
101-
* `--last-used` is also accepted.
101+
* `--last-used` is accepted as an alias.
102102
*
103-
* [--last_ip=<last_ip>]
103+
* [--last_ip=<last_ip>|last-ip]
104104
* : Filter by the IP address the application password was last used from.
105-
* `--last-ip` is also accepted.
105+
* `--last-ip` is accepted as an alias.
106106
*
107107
* [--field=<field>]
108108
* : Prints the value of a single field for each application password.
@@ -193,15 +193,6 @@ static function ( $a, $b ) use ( $orderby, $order ) {
193193

194194
$fields = self::APPLICATION_PASSWORD_FIELDS;
195195

196-
// Avoid confusion regarding the dash/underscore usage.
197-
foreach ( [ 'app-id', 'last-used', 'last-ip' ] as $flag ) {
198-
if ( array_key_exists( $flag, $assoc_args ) ) {
199-
$underscored_flag = str_replace( '-', '_', $flag );
200-
$assoc_args[ $underscored_flag ] = $assoc_args[ $flag ];
201-
unset( $assoc_args[ $flag ] );
202-
}
203-
}
204-
205196
foreach ( $fields as $field ) {
206197
if ( ! array_key_exists( $field, $assoc_args ) ) {
207198
continue;

0 commit comments

Comments
 (0)