Skip to content

Commit

Permalink
feat: add support for running pacman -D/F/Q/T
Browse files Browse the repository at this point in the history
  • Loading branch information
gamemaker1 committed Jun 17, 2021
1 parent b98b8a8 commit 636b218
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
5 changes: 4 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ makepkg -sfcCi
- Remove a package (`yeet -R <package-name>`)
- Build an AUR package using its PKGBUILD (`yeet -B <path to package dir>`)
- Upgrade all packages (`yeet -U`)
- Run pacman -Q (`yeet -Q`)
- Run pacman -D (`yeet -D [options]`)
- Run pacman -F (`yeet -F [options]`)
- Run pacman -Q (`yeet -Q [options]`)
- Run pacman -T (`yeet -T [options]`)

`yeet` can be configured using its config file, located at `$XDG_CONFIG_HOME/yeet/yeet.conf` OR `$HOME/.config/yeet/yeet.conf`. [Here](./assets/package/yeet.example.conf) is an example configuration.

Expand Down
9 changes: 6 additions & 3 deletions source/yeet
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ search_regex="\-s"
remove_regex="\-Rs*"
# yeet -B <path to package dir> - Build an AUR package
build_regex="\-B"
# yeet -Q [options] - Run pacman -Q
pacman_regex="\-Q.*"
# yeet -D/F/Q/T [options] - Run pacman -D/F/Q/T
pacman_regex="\-[DFQT].*"
# yeet <package search terms> - Search for a package and install it

# First check if the first param is an option
Expand Down Expand Up @@ -261,7 +261,7 @@ if [[ "$1" =~ $option_regex ]]; then
# Shift the params so the second one is the first, the third is the second and so on
shift
elif [[ "$1" =~ $pacman_regex ]]; then
# If the first option is -Q and the like (e.g., -Ql), then let pacman handle it
# If the first option is -D/F/Q/T and the like (e.g., -Dkk, -Fy, -Ql, -Tv), then let pacman handle it
operation="pacman"
else
# Invalid option, show help
Expand All @@ -284,7 +284,10 @@ function help {
printw "\e[0;34mInstall the specified package(s) \e[1;33m yeet -S <package name>"
printw "\e[0;34mRemove the specified package(s) \e[1;33m yeet -R <package name>"
printw "\e[0;34mBuild an AUR package \e[1;33m yeet -B <path to package dir>"
printw "\e[0;34mRun pacman -D \e[1;33m yeet -D [options]"
printw "\e[0;34mRun pacman -F \e[1;33m yeet -F [options]"
printw "\e[0;34mRun pacman -Q \e[1;33m yeet -Q [options]"
printw "\e[0;34mRun pacman -T \e[1;33m yeet -T [options]"
printw "\e[0;34mSearch for a package and install it \e[1;33m yeet <package search terms>"
}
# Update all packages
Expand Down

0 comments on commit 636b218

Please sign in to comment.