Page 1 of 1

Tiny feature request for slapt-mod

Posted: 27 May 2025, 21:32
by pterid
My puzzle for today...

If you want to search a package with a short name, e.g. the line editor named after a great contributor to this forum, you get a lot of results.

Code: Select all

root@porteus:/home/guest# slapt-mod -s ed | wc -l
1111
root@porteus:/home/guest# 
But if you change line 110 of slapt-mod from:

Code: Select all

        slapt-get --available | grep -i $PKG | awk '{print $1,"",substr($0,index($0,$4))}' 
to:

Code: Select all

        slapt-get --available | grep -i -E "^$PKG" | awk '{print $1,"",substr($0,index($0,$4))}' 
the results list is reduced from 1111 to 10, and the more exacting

Code: Select all

        slapt-get --available | grep -i -E "^$PKG-" | awk '{print $1,"",substr($0,index($0,$4))}' 
gives only the two correct results.

Could this behaviour be introduced as another mode, e.g. -s for contains, -S for exact match?

Tiny feature request for slapt-mod

Posted: 28 May 2025, 09:10
by pterid
My modified slapt-mod with -s|-S feature (including modified help text) is at

https://pastebin.com/LkBa1wt1

(pastebin expiry time: 6 months)

Tiny feature request for slapt-mod

Posted: 28 May 2025, 22:57
by ncmprhnsbl
looks good, thanks :) will be included

Tiny feature request for slapt-mod

Posted: 01 Jun 2025, 23:21
by pterid
ncmprhnsbl, thank you so much! This is my first technical "contribution" to an open source project, I hope not my last! :D