cmd/streamdata: list sub-command

This lists all known identifiers.

Signed-off-by: Yonah <contrib@gensokyo.uk>
This commit is contained in:
2026-03-19 01:46:10 +09:00
parent c6da581ec0
commit 63145c95bd

View File

@@ -4,6 +4,7 @@ import (
"bufio"
"context"
"errors"
"fmt"
"io"
"log"
"net/http"
@@ -205,6 +206,21 @@ func main() {
},
)
c.NewCommand(
"list",
"List identifiers of all known VODs",
func([]string) (err error) {
if channel == nil {
return errors.New("list requires a channel selected")
}
for ident := range channel.All(&err) {
fmt.Println(ident)
}
return
},
)
c.MustParse(os.Args[1:], func(err error) {
if channel != nil {
if closeErr := channel.Close(); closeErr != nil {