Skip to content

Commit

Permalink
Move media commands to subcommands.
Browse files Browse the repository at this point in the history
  • Loading branch information
barnybug committed Apr 2, 2016
1 parent fce0e9f commit 87c4881
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 16 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ https://github.com/barnybug/go-cast/releases/latest

Play a media file:

$ cast --name Hifi play http://url/file.mp3
$ cast --name Hifi media play http://url/file.mp3

Stop playback:

$ cast --name Hifi stop
$ cast --name Hifi media stop

Set volume:

Expand Down
34 changes: 20 additions & 14 deletions cmd/cast/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +61,26 @@ func main() {
app.Flags = commonFlags
app.Commands = []cli.Command{
{
Name: "play",
Usage: "play some media",
ArgsUsage: "play url [content type]",
Action: cliCommand,
},
{
Name: "stop",
Usage: "stop playing",
Action: cliCommand,
},
{
Name: "pause",
Usage: "pause playing",
Action: cliCommand,
Name: "media",
Usage: "media commands",
Subcommands: []cli.Command{
{
Name: "play",
Usage: "play some media",
ArgsUsage: "play url [content type]",
Action: cliCommand,
},
{
Name: "stop",
Usage: "stop playing media",
Action: cliCommand,
},
{
Name: "pause",
Usage: "pause playing media",
Action: cliCommand,
},
},
},
{
Name: "volume",
Expand Down

0 comments on commit 87c4881

Please sign in to comment.