mirror of
https://github.com/lunchcat/sif.git
synced 2026-07-28 14:37:01 -07:00
feat: pipe mode (stdin targets, naked-host, -silent plain output)
sif can now slot into unix pipelines. stdin is drained for targets when it's a pipe (keyed off stdin's mode, not stdout), alongside -u/-f. naked hosts are accepted and default to https://; explicit http(s) is kept, other schemes rejected. -silent routes all banner/spinner/log chrome to stderr and prints one normalized finding per line to stdout via finding.Flatten, so `subfinder | sif -silent | notify` works.
This commit is contained in:
@@ -98,7 +98,7 @@ func (p *Progress) Done() {
|
||||
}
|
||||
|
||||
func (p *Progress) render() {
|
||||
if apiMode {
|
||||
if apiMode || silent {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ func (p *Progress) render() {
|
||||
p.mu.Unlock()
|
||||
|
||||
if advanced {
|
||||
fmt.Printf(" [%d%%] %d/%d\n", percent, current, total)
|
||||
fmt.Fprintf(sink, " [%d%%] %d/%d\n", percent, current, total)
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -190,5 +190,5 @@ func (p *Progress) render() {
|
||||
)
|
||||
|
||||
ClearLine()
|
||||
fmt.Print(line)
|
||||
fmt.Fprint(sink, line)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user