add port_grep and update doc

This commit is contained in:
Aaron Bieber 2020-08-24 14:54:54 +00:00
parent 3c06bc9d76
commit c922fb9f71
2 changed files with 8 additions and 0 deletions

View File

@ -8,6 +8,13 @@ port() {
return
}
port_grep() {
local _usage
_usage="port_grep [file] [pattern]"
[ -z $1 ] || [ -z $2 ] && echo $_usage
[ ! -z $1 ] && [ ! -z $2 ] && find /usr/ports -iname "${1}" -exec grep -iH ${2} {} \;
}
pclean() {
find . -name \*.orig -exec rm {} \;
find . -size 0 -exec rm {} \;

View File

@ -10,6 +10,7 @@ The following functions are added:
| maintains() | Similar to ~port()~, this will display the ~$MAINTAINER~ of a port passed in as the first argument. |
| pclean() | Remove ~.orig~ and empty files from ~$CWD~. |
| port() | Like ~src()~, but for ~/usr/ports~. |
| port_grep() | Recursively search ports tree for [file]'s that contain [pattern]. |
| seq() | A shell implementation of Linux's [[https://linux.die.net/man/1/seq][seq(1)]] command. It supports alpha and numeric ranges. |
| src() | Similar to plan9's [[http://man.9front.org/1/src][src(1)]] command. It drops you to ~/usr/src/*/<arg 1>~. |