diff --git a/.travis.yml b/.travis.yml index f8afcfb..19e2e1e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,4 +14,4 @@ before_install: script: - gox -output "dist/{{.OS}}_{{.Arch}}_{{.Dir}}" - - ghr --username syui --token $GITHUB_TOKEN --replace --debug 0.3.2 dist/ + - ghr --username syui --token $GITHUB_TOKEN --replace --debug 0.3.3 dist/ diff --git a/readme.md b/readme.md index aeb5cf8..4b1fa62 100644 --- a/readme.md +++ b/readme.md @@ -92,3 +92,6 @@ $ xq l d index.xml - 0.3.1 : fix version, $ xq v - 0.3.2 : add alias sub-command, $ xq l d ./index.xml + +- 0.3.3 : fix option/all, $ xq a ./index.xml + diff --git a/xq.go b/xq.go index 8c0b95f..ff8b5a7 100644 --- a/xq.go +++ b/xq.go @@ -41,9 +41,9 @@ func Action(c *cli.Context) { func main() { app := &cli.App{ - Version: "0.3.2", + Version: "0.3.3", Name: "xq", - Usage: "$ xq index.xml", + Usage: "$ xq index.xml #xml -> json", Action: func(c *cli.Context) error { if c.Args().Get(0) == "" { help := []string{"xq", "--help"} @@ -180,18 +180,14 @@ func main() { { Name: "all", Aliases: []string{"a"}, - Usage: "xq a ./index.xml #json", + Usage: "xq a ./index.xml #src date", Action: func(c *cli.Context) error { file, _ := os.Open(c.Args().First()) defer file.Close() fp := gofeed.NewParser() feed, _ := fp.Parse(file) items := feed.Items - outputJson, err := json.Marshal(&items) - if err != nil { - panic(err) - } - fmt.Printf("%s", string(outputJson)) + fmt.Printf("%s", items) return nil }, },