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

add: fpm search #1054

Open
wants to merge 57 commits into
base: main
Choose a base branch
from
Open

add: fpm search #1054

wants to merge 57 commits into from

Conversation

henilp105
Copy link
Member

@henilp105 henilp105 commented Jun 22, 2024

This PR intends to add the search and discovery of fpm installed and fpm - registry packages directly from cli. this command supports globbing for package name, version, license, namespace. the similar functionality has been patched at the registry repo. (fortran-lang/registry#81). paging is not used in local registry due to multiple search queries.

This is the syntax of the new fpm search functionality:

fpm search --query q* --page 1 --registry URL --namespace n* --package p* --package_version v* --license l* --limit 10 --sort-by [name] --sort [asc/desc]

Parameters:

  • query: Searches in fpm.toml description and fpm-registry descriptions only for fpm-registry (README.md) (case insensitive, globbing supported).
  • package: Searches by package name (case insensitive, globbing supported).
  • registry: Custom registry URL (default: fpm-registry).
  • namespace: Searches by namespace (globbing supported).
  • package_version: Searches by package version (globbing supported).
  • license: Searches by license (globbing supported).
  • page: Page number (default: 1).
  • limit: Number of results (default: 10).
  • sort-by: Sorts by name, author, createdat, updatedat, downloads (default: name).
  • sort: Order of sorting, asc or desc (default: asc).

Tasks left

  • add docs and tests
  • clean and refactor

Thanks and Regards,
Henil

CC @certik @awvwgk @perazz @arteevraina

@henilp105 henilp105 requested a review from perazz June 23, 2024 05:50
src/fpm_command_line.f90 Outdated Show resolved Hide resolved
' --license License type to filter results.', &
' --limit Maximum number of results to return.', &
' --sort-by Field to sort results by (e.g., name).', &
' --sort Sort order (asc for ascending, desc for descending).', &
Copy link
Contributor

@perazz perazz Jun 24, 2024

Choose a reason for hiding this comment

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

It would be extremely beneficial to add a few examples of search commands that can be used to search for packages. That gives the reader a better idea of what the command can do, how it works, and how it is integrated with either a local registry or the online registry.

Copy link
Member Author

Choose a reason for hiding this comment

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

I will add some sample queries for each parameter so that it is easy to refer.

@perazz perazz mentioned this pull request Jul 22, 2024
2 tasks
@perazz
Copy link
Contributor

perazz commented Sep 9, 2024

Let's get this merged @henilp105, is there any more tasks you plan of adding?

@henilp105
Copy link
Member Author

Sure @perazz , Let's get this merged in a week, I will add some tests and clean UI by then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants