clipmenu

Simple clipboard management using dmenu
git clone https://git.sinitax.com/cdown/clipmenu
Log | Files | Refs | README | LICENSE | sfeed.txt

commit da1ccb7c709c96fecd5a0e56ada445a5fbebadcf
parent a9fb4c9823283d83321dd1a87ca3452b5d87b16c
Author: Chris Down <chris@chrisdown.name>
Date:   Mon, 23 Mar 2020 17:45:33 +0000

get_first_line: Simplify END logic

Diffstat:
Mclipmenud | 10+++-------
1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/clipmenud b/clipmenud @@ -48,19 +48,15 @@ get_first_line() { # first line that can provide reasonable context to the user. awk -v limit=300 ' BEGIN { printed = 0; } - printed == 0 && NF { $0 = substr($0, 0, limit); printf("%s", $0); printed = 1; } - END { - if (NR > 1) { - print " (" NR " lines)"; - } else { - printf("\n"); - } + if (NR > 1) + printf(" (%d lines)", NR); + printf("\n"); }' <<< "$data" }