summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorAlex Goodman <wagoodman@users.noreply.github.com>2018-06-07 15:51:10 -0400
committerGitHub <noreply@github.com>2018-06-07 15:51:10 -0400
commite67734d38d0641cae0ac052ba7d4b76ed0a39432 (patch)
tree5113dc1b53b267fa2d9edc038800a8137ad2b4d4 /cmd
parentacec6703548bbdec584ad3a1f6937284bdf8ceff (diff)
Added debug panel; annotate filetree with changeinfo (#7)
Diffstat (limited to 'cmd')
-rw-r--r--cmd/die/main.go31
1 files changed, 21 insertions, 10 deletions
diff --git a/cmd/die/main.go b/cmd/die/main.go
index ab39ead..fa9b019 100644
--- a/cmd/die/main.go
+++ b/cmd/die/main.go
@@ -1,7 +1,11 @@
package main
import (
+ "fmt"
+ "log"
"os"
+
+ "github.com/urfave/cli"
"github.com/wagoodman/docker-image-explorer/image"
"github.com/wagoodman/docker-image-explorer/ui"
)
@@ -11,15 +15,22 @@ const version = "v0.0.0"
const author = "wagoodman"
func main() {
- os.Exit(run(os.Args))
-}
-
+ app := cli.NewApp()
+ app.Name = "die"
+ app.Usage = "Explore your docker images"
+ app.Action = func(c *cli.Context) error {
+ userImage := c.Args().Get(0)
+ if userImage == "" {
+ fmt.Println("No image argument given")
+ os.Exit(1)
+ }
+ manifest, refTrees := image.InitializeData(userImage)
+ ui.Run(manifest, refTrees)
+ return nil
+ }
-func run(args []string) int {
- image.WriteImage()
- manifest, refTrees := image.InitializeData()
-
- ui.Run(manifest, refTrees)
- return 0
+ err := app.Run(os.Args)
+ if err != nil {
+ log.Fatal(err)
+ }
}
-