hc forward show: hits, comment, and hairpin without a stray dash

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
abrown38andClaude Opus 5.5 committed 2026-10-23 18:06:39 +01:00
1 parent 1fcc204ff8
commit b4c098890c
2 files changed
+12 -1

No files matched your search

+2
View File
@@ -162,6 +162,8 @@ All notable changes to Housecarl are documented here. The format follows
### Fixed ### Fixed
- `hc forward show` shows the forward's hits and comment, and its
hairpin as `no`, `yes` or `yes, from …` (it printed `no -`).
- A history entry's ruleset diff showed the object it changed as moved: - A history entry's ruleset diff showed the object it changed as moved:
stepping back put the old form at the end of its list, so updating stepping back put the old form at the end of its list, so updating
one port forward (turning hairpin off) also showed its forward and one port forward (turning hairpin off) also showed its forward and
+10 -1
View File
@@ -605,7 +605,16 @@ func forwardCmd() *cobra.Command {
if f.ToPort != "" { if f.ToPort != "" {
fmt.Fprintf(w, "To port:\t%s\n", f.ToPort) fmt.Fprintf(w, "To port:\t%s\n", f.ToPort)
} }
fmt.Fprintf(w, "To (IPv6):\t%s\nFrom:\t%s\nHairpin:\t%s %s\n", orDash(f.To6), list(f.Sources), yesNo(f.Hairpin), list(f.HairpinSources)) hairpin := yesNo(f.Hairpin)
if f.Hairpin && len(f.HairpinSources) > 0 {
hairpin += ", from " + list(f.HairpinSources)
}
fmt.Fprintf(w, "To (IPv6):\t%s\nFrom:\t%s\nHairpin:\t%s\n", orDash(f.To6), list(f.Sources), hairpin)
if f.Comment != "" {
fmt.Fprintf(w, "Comment:\t%s\n", f.Comment)
}
cs := counters()
fmt.Fprintf(w, "Hits:\t%s\n", hits(cs, fmt.Sprintf("f%d", f.ID), fmt.Sprintf("f%d-6", f.ID)))
})) }))
var pf model.PortForward var pf model.PortForward
var to string var to string