Skip to content

Commit

Permalink
fix cmd tool
Browse files Browse the repository at this point in the history
  • Loading branch information
kkdai committed Nov 6, 2021
1 parent 059c04e commit a9e4d88
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmd/ptt_cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func main() {
Run: func(cmd *cobra.Command, args []string) {
page := 0
pagePostCount := 0
pagePostCount = ptt.ParsePttPageByIndex(page)
pagePostCount = ptt.ParsePttPageByIndex(page, true)
printPageResult(ptt, pagePostCount)

scanner := bufio.NewScanner(os.Stdin)
Expand All @@ -67,17 +67,17 @@ func main() {
quit = true
case "n":
page = page + 1
pagePostCount = ptt.ParsePttPageByIndex(page)
pagePostCount = ptt.ParsePttPageByIndex(page, true)
printPageResult(ptt, pagePostCount)
case "p":
if page > 0 {
page = page - 1
}
pagePostCount = ptt.ParsePttPageByIndex(page)
pagePostCount = ptt.ParsePttPageByIndex(page, true)
printPageResult(ptt, pagePostCount)
case "s":
page = 0
pagePostCount = ptt.ParsePttPageByIndex(page)
pagePostCount = ptt.ParsePttPageByIndex(page, true)
printPageResult(ptt, pagePostCount)
case "o":
open.Run(filepath.FromSlash(ptt.BaseDir))
Expand Down

0 comments on commit a9e4d88

Please sign in to comment.