|
|
@ -54,7 +54,7 @@ Flags
|
|
|
|
-i --indent number of spaces to use for indent or character
|
|
|
|
-i --indent number of spaces to use for indent or character
|
|
|
|
-n --number print number of elements selected
|
|
|
|
-n --number print number of elements selected
|
|
|
|
-l --limit restrict number of levels printed
|
|
|
|
-l --limit restrict number of levels printed
|
|
|
|
-u --unescape don't escape html
|
|
|
|
-p --plain don't escape html
|
|
|
|
--charset specify the charset for pup to use
|
|
|
|
--charset specify the charset for pup to use
|
|
|
|
--version display version
|
|
|
|
--version display version
|
|
|
|
`
|
|
|
|
`
|
|
|
@ -85,7 +85,7 @@ func ProcessFlags(cmds []string) (nonFlagCmds []string, err error) {
|
|
|
|
switch cmd {
|
|
|
|
switch cmd {
|
|
|
|
case "-c", "--color":
|
|
|
|
case "-c", "--color":
|
|
|
|
pupPrintColor = true
|
|
|
|
pupPrintColor = true
|
|
|
|
case "-u", "--unescape":
|
|
|
|
case "-p", "--plain":
|
|
|
|
pupEscapeHTML = false
|
|
|
|
pupEscapeHTML = false
|
|
|
|
case "-f", "--file":
|
|
|
|
case "-f", "--file":
|
|
|
|
filename := cmds[i+1]
|
|
|
|
filename := cmds[i+1]
|
|
|
@ -117,6 +117,8 @@ func ProcessFlags(cmds []string) (nonFlagCmds []string, err error) {
|
|
|
|
case "--version":
|
|
|
|
case "--version":
|
|
|
|
fmt.Println(VERSION)
|
|
|
|
fmt.Println(VERSION)
|
|
|
|
os.Exit(0)
|
|
|
|
os.Exit(0)
|
|
|
|
|
|
|
|
case "-n", "--number":
|
|
|
|
|
|
|
|
pupDisplayer = NumDisplayer{}
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
if cmd[0] == '-' {
|
|
|
|
if cmd[0] == '-' {
|
|
|
|
return []string{}, fmt.Errorf("Unrecognized flag '%s'", cmd)
|
|
|
|
return []string{}, fmt.Errorf("Unrecognized flag '%s'", cmd)
|
|
|
|