mirror of
https://github.com/bluenviron/mediamtx
synced 2025-03-11 06:47:58 +00:00
remove stdin
This commit is contained in:
parent
5c8eceb4f7
commit
e724c3ba1e
@ -251,8 +251,7 @@ Flags:
|
|||||||
--version print version
|
--version print version
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
[<confpath>] path to a config file. The default is rtsp-simple-server.yml. Use 'stdin' to
|
[<confpath>] path to a config file. The default is rtsp-simple-server.yml.
|
||||||
read config from stdin
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Compile and run from source
|
### Compile and run from source
|
||||||
|
5
main.go
5
main.go
@ -2,7 +2,6 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
|
||||||
"log"
|
"log"
|
||||||
"net"
|
"net"
|
||||||
"os"
|
"os"
|
||||||
@ -59,7 +58,7 @@ type program struct {
|
|||||||
done chan struct{}
|
done chan struct{}
|
||||||
}
|
}
|
||||||
|
|
||||||
func newProgram(args []string, stdin io.Reader) (*program, error) {
|
func newProgram(args []string) (*program, error) {
|
||||||
k := kingpin.New("rtsp-simple-server",
|
k := kingpin.New("rtsp-simple-server",
|
||||||
"rtsp-simple-server "+Version+"\n\nRTSP server.")
|
"rtsp-simple-server "+Version+"\n\nRTSP server.")
|
||||||
|
|
||||||
@ -399,7 +398,7 @@ func (p *program) close() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
_, err := newProgram(os.Args[1:], os.Stdin)
|
_, err := newProgram(os.Args[1:])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal("ERR: ", err)
|
log.Fatal("ERR: ", err)
|
||||||
}
|
}
|
||||||
|
@ -103,7 +103,7 @@ func (c *container) ip() string {
|
|||||||
|
|
||||||
func testProgram(conf string) (*program, error) {
|
func testProgram(conf string) (*program, error) {
|
||||||
if conf == "" {
|
if conf == "" {
|
||||||
return newProgram([]string{}, nil)
|
return newProgram([]string{})
|
||||||
}
|
}
|
||||||
|
|
||||||
tmpf, err := ioutil.TempFile(os.TempDir(), "rtsp-")
|
tmpf, err := ioutil.TempFile(os.TempDir(), "rtsp-")
|
||||||
@ -115,7 +115,7 @@ func testProgram(conf string) (*program, error) {
|
|||||||
tmpf.WriteString(conf)
|
tmpf.WriteString(conf)
|
||||||
tmpf.Close()
|
tmpf.Close()
|
||||||
|
|
||||||
return newProgram([]string{tmpf.Name()}, nil)
|
return newProgram([]string{tmpf.Name()})
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestEnvironment(t *testing.T) {
|
func TestEnvironment(t *testing.T) {
|
||||||
|
Loading…
Reference in New Issue
Block a user