From 86fa13b7c90a3f3df2aa12bdf074f7478e5b90ae Mon Sep 17 00:00:00 2001 From: "Ciro S. Costa" Date: Mon, 2 Jul 2018 10:15:29 -0300 Subject: [PATCH] Adds command boilerplate --- commands/max-delay.go | 15 +++++++++++++++ editor/editor_suite_test.go | 13 +++++++++++++ editor/editor_test.go | 12 ++++++++++++ main.go | 14 ++++++++++++-- 4 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 commands/max-delay.go create mode 100644 editor/editor_suite_test.go create mode 100644 editor/editor_test.go diff --git a/commands/max-delay.go b/commands/max-delay.go new file mode 100644 index 0000000..de44d63 --- /dev/null +++ b/commands/max-delay.go @@ -0,0 +1,15 @@ +package commands + +import ( + "gopkg.in/urfave/cli.v1" +) + +var MaxDelay = cli.Command{ + Name: "max-delay", + Usage: "cuts all delays between commands up to a maximum value", + Action: maxDelayAction, +} + +func maxDelayAction(c *cli.Context) (err error) { + return +} diff --git a/editor/editor_suite_test.go b/editor/editor_suite_test.go new file mode 100644 index 0000000..987ca6a --- /dev/null +++ b/editor/editor_suite_test.go @@ -0,0 +1,13 @@ +package editor_test + +import ( + "testing" + + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" +) + +func TestEditor(t *testing.T) { + RegisterFailHandler(Fail) + RunSpecs(t, "Editor Suite") +} diff --git a/editor/editor_test.go b/editor/editor_test.go new file mode 100644 index 0000000..97d81be --- /dev/null +++ b/editor/editor_test.go @@ -0,0 +1,12 @@ +package editor_test + +import ( + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" + + . "github.com/cirocosta/asciinema-edit/editor" +) + +var _ = Describe("Editor", func() { + +}) diff --git a/main.go b/main.go index d70a5a2..1a880cc 100644 --- a/main.go +++ b/main.go @@ -1,6 +1,9 @@ package main import ( + "os" + + "github.com/cirocosta/asciinema-edit/commands" "gopkg.in/urfave/cli.v1" ) @@ -8,9 +11,16 @@ var ( version = "dev" ) -func main () { +func main() { app := cli.NewApp() - app.Commands = []cli.Command{} app.Version = version + app.Usage = "edit recorded asciinema casts" + app.Description = `asciinema-edit provides missing features from the "asciinema" tool + when it comes to editing a cast that has already been recorded.` + app.Commands = []cli.Command{ + commands.MaxDelay, + } + + app.Run(os.Args) }