No known key found for this signature in database
GPG Key ID: ED2A0F5F1DA25512
3 changed files with
9 additions and
10 deletions
-
.travis.yml
-
readme.md
-
xq.go
|
|
@ -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/ |
|
|
|
|
|
@ -89,6 +89,9 @@ $ xq l d index.xml |
|
|
|
|
|
|
|
- 0.3.0 : option/[l]atest, sub-command/{link, title, published, description}, $ xq l link ./index.xml |
|
|
|
|
|
|
|
- 0.3.1 : fix version, $ xq v |
|
|
|
- 0.3.1 : fix version, $ xq -v |
|
|
|
|
|
|
|
- 0.3.2 : add alias sub-command, $ xq l d ./index.xml |
|
|
|
|
|
|
|
- 0.3.3 : change option/all, $ xq a ./index.xml |
|
|
|
|
|
|
|
|
|
@ -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 |
|
|
|
}, |
|
|
|
}, |
|
|
|