Skip to content

Commit

Permalink
more examples for searchBy
Browse files Browse the repository at this point in the history
  • Loading branch information
Toni500github committed Apr 26, 2024
1 parent d0455f4 commit 1407b21
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion include/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ inline const string AUTOCONFIG = R"#([general]
# Please activate this before reporting bugs on our Github repo, thank you :)
#debug = true
# Search AUR packages based on what (e.g "name-desc", "makedepends")
# Search AUR packages based on what
# Available options: "name", "name-desc", "depends", "makedepends", "optdepends", "checkdepends"
#searchBy = "name-desc"
# Where we are gonna download the AUR packages (default $XDG_CACHE_HOME/TabAUR, else ~/.cache/TabAUR)
Expand Down
2 changes: 1 addition & 1 deletion src/taur.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ vector<TaurPkg_t> TaurBackend::search_pac(string query) {
vector<TaurPkg_t> TaurBackend::search(string query, bool useGit, bool checkExactMatch) {
if (query.empty())
return vector<TaurPkg_t>();
// link to AUR API
// link to AUR API. Took search pattern from yay
cpr::Url url(("https://aur.archlinux.org/rpc?arg%5B%5D=" + cpr::util::urlEncode(query) + "&by=" + config.getConfigValue("searchBy", "name-desc") + "&type=search&v=5"));
log_println(LOG_DEBUG, "url search = {}", url.str());
cpr::Response r = cpr::Get(url);
Expand Down

0 comments on commit 1407b21

Please sign in to comment.