Skip to content

Commit

Permalink
feat: add -s --skip flag
Browse files Browse the repository at this point in the history
  • Loading branch information
ycd committed Jan 21, 2021
1 parent 9c3bccd commit 0937464
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/toc/toc.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ func (t *toc) logic() {
}

func (t *toc) String() (s string) {
for _, v := range t.Content {
if t.Options.Skip >= len(t.Content) {
color.Red("ERROR: skip value is bigger than the length of table of contents")
os.Exit(1)
}
for _, v := range t.Content[t.Options.Skip:] {
s += v
}

Expand Down

0 comments on commit 0937464

Please sign in to comment.