cmd/streamdata: list sub-command
This lists all known identifiers. Signed-off-by: Yonah <contrib@gensokyo.uk>
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
|||||||
"bufio"
|
"bufio"
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"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) {
|
c.MustParse(os.Args[1:], func(err error) {
|
||||||
if channel != nil {
|
if channel != nil {
|
||||||
if closeErr := channel.Close(); closeErr != nil {
|
if closeErr := channel.Close(); closeErr != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user