Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Specify user by ID in assign-user-to-coauthor #698

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

Floppy
Copy link

@Floppy Floppy commented Aug 5, 2019

If a user has already been deleted, we need to specify just the user ID when assigning coauthors, instead of the login. This PR adds a second command-line option. One of either --user_id or --user_login is required. Existing behaviour should be unchanged.

php/class-wp-cli.php Outdated Show resolved Hide resolved
@@ -210,30 +210,36 @@ public function assign_coauthors( $args, $assoc_args ) {
* @since 3.0
*
* @subcommand assign-user-to-coauthor
* @synopsis --user_login=<user-login> --coauthor=<coauthor>
* @synopsis --user_login=<user-login> --user_id=<user-id> --coauthor=<coauthor>
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not at all sure how to specify that one of user_login or user_id is required. Anyone else?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In git's man pages, parentheses and pipes are used to indicate that a subcommand accepts one and only one of a selection of flags (see the last line):

SYNOPSIS
       git rebase [-i | --interactive] [<options>] [--exec <cmd>] [--onto <newbase>]
               [<upstream> [<branch>]]
       git rebase [-i | --interactive] [<options>] [--exec <cmd>] [--onto <newbase>]
               --root [<branch>]
       git rebase (--continue | --skip | --abort | --quit | --edit-todo | --show-current-patch)

So this line could be rewritten as:

	 * @synopsis ( --user_login=<user-login> | --user_id=<user-id> ) --coauthor=<coauthor>

php/class-wp-cli.php Outdated Show resolved Hide resolved
php/class-wp-cli.php Outdated Show resolved Hide resolved
@GaryJones
Copy link
Contributor

Can you please refresh and fix the conflicts?

@GaryJones GaryJones added this to the Future milestone Jul 27, 2023
@GaryJones GaryJones changed the base branch from main to develop August 25, 2023 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants