mirror of
https://github.com/ericchiang/pup
synced 2024-11-28 02:48:16 +00:00
commit
96b2c17c6a
8
main.go
8
main.go
@ -2,6 +2,7 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"code.google.com/p/go.net/html"
|
"code.google.com/p/go.net/html"
|
||||||
|
"code.google.com/p/go.net/html/charset"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/ericchiang/pup/funcs"
|
"github.com/ericchiang/pup/funcs"
|
||||||
"github.com/ericchiang/pup/selector"
|
"github.com/ericchiang/pup/selector"
|
||||||
@ -115,7 +116,12 @@ func ProcessFlags(cmds []string) []string {
|
|||||||
// pup
|
// pup
|
||||||
func main() {
|
func main() {
|
||||||
cmds := ProcessFlags(os.Args[1:])
|
cmds := ProcessFlags(os.Args[1:])
|
||||||
root, err := html.Parse(inputStream)
|
cr, err := charset.NewReader(inputStream, "")
|
||||||
|
if err != nil {
|
||||||
|
fmt.Fprintf(os.Stderr, err.Error())
|
||||||
|
os.Exit(2)
|
||||||
|
}
|
||||||
|
root, err := html.Parse(cr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, err.Error())
|
fmt.Fprintf(os.Stderr, err.Error())
|
||||||
os.Exit(2)
|
os.Exit(2)
|
||||||
|
Loading…
Reference in New Issue
Block a user