Skip to content

Commit 96e674a

Browse files
Changed urls color and added suggestion to use pager for better experience
1 parent 9553330 commit 96e674a

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,9 @@ Output:
7878
7979
![Screenshot from 2024-11-14 10-16-52](https://github.com/user-attachments/assets/43282839-1719-44ae-a0e8-c2ed44d8e9e6)
8080
81+
You can also use `less` command for instance to page through the results:
82+
```shell
83+
#!/bin/bash
84+
goso "$@" | less -F -R -X
85+
```
86+

goso.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ const (
3636
answerColor string = "\033[38;5;255m"
3737
downvoted string = "\033[38;5;160m"
3838
lightgray string = "\033[38;5;248m"
39+
urlColor string = "\033[38;5;248m"
3940
terminalMaxWidth int = 80
4041
)
4142

@@ -314,7 +315,7 @@ func fmtText(text string) string {
314315
t := r.Replace(html.UnescapeString(text))
315316
t = strings.ReplaceAll(t, "<hr>", strings.Repeat("─", terminalWidth))
316317
t = divPattern.ReplaceAllString(t, "")
317-
t = aHrefPattern.ReplaceAllString(t, "\n - $2")
318+
t = aHrefPattern.ReplaceAllString(t, fmt.Sprintf("\n %s- $2%s", urlColor, reset))
318319
t = bqPattern.ReplaceAllString(t, italic)
319320
return t
320321
}

0 commit comments

Comments
 (0)