config

OpenBSD system configuration
git clone git://jacobedwards.org/config
Log | Files | Refs | README

commit aa64fa37caea68161c96b43a789e719f767fe8b2
parent 2334cd4735c1b00cd2890085f815697a9f510d6a
Author: Jacob R. Edwards <jacobouno@protonmail.com>
Date:   Fri,  2 Apr 2021 22:15:42 -0700

Replace the pq function with a script

Add the portslist script which lists all port names and versions
optionally with a description.  The pq function now simply points
to portslist.

Diffstat:
Alocal/bin/.local/bin/portslist | 15+++++++++++++++
Mlocal/shell/.local/share/shell/openbsd | 2+-
2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/local/bin/.local/bin/portslist b/local/bin/.local/bin/portslist @@ -0,0 +1,15 @@ +#!/bin/sh +# Copyright 2021 Jacob R. Edwards +# License: GPLv3 +# +# portslist -- list OpenBSD ports (requires portslist) +# +# -v display extra information about the port + +list() tr "$@" '|' '\t' </usr/local/share/ports-INDEX + +if test "$1" = '-v'; then + shift && list | cut -f1,4 "$@" +else + list | cut -f1 "$@" +fi diff --git a/local/shell/.local/share/shell/openbsd b/local/shell/.local/share/shell/openbsd @@ -8,5 +8,5 @@ pa() doas pkg_add "$@" pd() doas pkg_delete "$@" pi() pkg_info -q "$@" pl() pkg_locate "${@:-.}" -pq() { cut -d'|' -f2,4 </usr/local/share/ports-INDEX | tr '|' '\t' | egrep "${@:-.}" ;} +pq() portslist "$@" pu() doas pkg_add -u "$@"