From 87c4881bcbf009e0df650ac77ff1dbe959b2fec4 Mon Sep 17 00:00:00 2001 From: Barnaby Gray Date: Sat, 2 Apr 2016 19:02:44 +0100 Subject: [PATCH] Move media commands to subcommands. --- README.md | 4 ++-- cmd/cast/main.go | 34 ++++++++++++++++++++-------------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 302726d..a23764a 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/cmd/cast/main.go b/cmd/cast/main.go index ac6f640..a0a2901 100644 --- a/cmd/cast/main.go +++ b/cmd/cast/main.go @@ -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",