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

occ app:list filter #28640

Merged
merged 2 commits into from
Aug 11, 2017
Merged

occ app:list filter #28640

merged 2 commits into from
Aug 11, 2017

Conversation

phil-davis
Copy link
Contributor

Description

  • Allow a search-pattern to be entered as a parameter to oc app:list so the user can filter the list to just matching app names.
  • only print the "Enabled:" and "Disabled:" sections of output if they have at least 1 app in them
  • make use of this in the integration tests run.sh script to preserve the existing state of the testing app

Related Issue

#28638

Motivation and Context

  • it is handy for a script to have some way to know if an app is currently enabled or disabled
  • it could be handy for sysadmins to be able to filter the output of occ app:list, that possibility comes for free here

How Has This Been Tested?

  • enable the testing app
  • run some integration tests
  • verify that the testing app is still enabled
  • disable the testing app
  • run some integration tests
  • verify that the testing app is disabled

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

->addArgument(
'search-pattern',
InputArgument::OPTIONAL,
'Restrict the list to apps whose name matches the given regular expression'
Copy link
Member

Choose a reason for hiding this comment

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

to -> of

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I used similar words to https://github.com/owncloud/core/blob/master/core/Command/User/ListUsers.php#L51

I could be more verbose and say:

Restrict the list of apps to those whose name matches the given regular expression

@phil-davis phil-davis added this to the development milestone Aug 10, 2017
@phil-davis
Copy link
Contributor Author

Note: I would like to make use of this from firewall testing scripts, to avoid the firewall app getting disabled on me all the time. There are probably other app testing scripts that could also make use of this to improve their friendliness.

@PVince81
Copy link
Contributor

what admin is patient enough to type "--search-pattern" ? please make that "--search"

@phil-davis
Copy link
Contributor Author

phil-davis commented Aug 10, 2017

It is an argument, not a command option:

occ app:list firewall

is all that is needed
similar to occ user:list

@phil-davis
Copy link
Contributor Author

@DeepDiver1975 @PVince81 questions addressed, I think. Please re-review.

Copy link
Contributor

@PVince81 PVince81 left a comment

Choose a reason for hiding this comment

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

👍

@PVince81 PVince81 merged commit d9f3d1d into master Aug 11, 2017
@PVince81 PVince81 deleted the occ-app-list-filter branch August 11, 2017 08:58
@phil-davis
Copy link
Contributor Author

Backport to stable10 #28653

@phil-davis
Copy link
Contributor Author

@lock
Copy link

lock bot commented Aug 2, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants