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

feat(command): Print a success message with the add/remove use occ command #44392

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zak39
Copy link
Contributor

@zak39 zak39 commented Mar 21, 2024

Summary

Before

When we add or remove an user from a group. The end-user doesn't know if the command was successful or not.

image
image

After

Now, the end-user is informed when he/she adds or removes an user from a group with the occ command.

image
image

TODO

  • Install your Nextcloud instance
  • Create a few users
  • Create a few groups
  • From the terminal, run the following commands :
    • php occ group:adduser <groupname> <uid>
    • php occ group:remove <groupname> <uid>

Checklist

Inform the end-user when he/she add or remove user from a group with the
occ command.

Signed-off-by: Baptiste Fotia <[email protected]>
@susnux
Copy link
Contributor

susnux commented Mar 21, 2024

When we add or remove an user from a group. The end-user doesn't know if the command was successful or not.

They do. The return code is either 0 for success (as usual) and non zero otherwise.

You can even configure your shell to show the exit code visually, or do
php occ group:adduser <groupname> <uid> && echo 'success'

@zak39
Copy link
Contributor Author

zak39 commented Mar 22, 2024

Hi @susnux :)

Yes, I know. But, I think it's not clear to some people.
Whether they are beginner or senior.

My suggestion is to clearly display a success message to confirm that the order is working.

Like the php occ app:enable <appid> command, which shows that the app is enabled.

@tcitworld
Copy link
Member

Instead of just success, it could have a proper sentence: User $uid was added/removed to/from group $gid

@zak39
Copy link
Contributor Author

zak39 commented Mar 27, 2024

Instead of just success, it could have a proper sentence: User $uid was added/removed to/from group $gid

Yes, I think it's a good idea ! 👍

Should I wait for the developers Nextcloud or community to approve your suggestion ?

@come-nc
Copy link
Contributor

come-nc commented Mar 28, 2024

I agree with @tcitworld, make sure the message is informative.
Also double check that --quiet works as expected and silence your added output, for scripts which would want the old behavior.

@susnux susnux added this to the Nextcloud 30 milestone Apr 18, 2024
This was referenced Jul 30, 2024
This was referenced Aug 5, 2024
@skjnldsv skjnldsv mentioned this pull request Aug 13, 2024
@skjnldsv skjnldsv modified the milestones: Nextcloud 30, Nextcloud 31 Aug 14, 2024
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.

5 participants