Flag more than 8 examples in tldr-linter
This commit is contained in:
parent
c43af0e308
commit
b208d684f2
|
@ -1,14 +1,14 @@
|
|||
#!/usr/bin/env bash
|
||||
set +vx
|
||||
[[ $- = *i* ]] && echo "Don't source this script!" && return 1
|
||||
version='0.11'
|
||||
# tldr-lint version 0.11
|
||||
version='0.12'
|
||||
# tldr-lint version 0.12
|
||||
# Linter for new syntax tldr source files
|
||||
# Old syntax files $f can be changed into new syntax files by:
|
||||
# sed -i -e "1s/^# //" -e 's/^- //' -e 's/^`\(.*\)`$/ \1/' "$f"
|
||||
# e=$(sed '1s/./=/g;q' "$f") sed -i "2i$e" "$f"
|
||||
# Part of http://github.com/pepa65/tldr-bash-client
|
||||
# Requirements: coreutils, sed, grep, find
|
||||
# Requirements: coreutils sed grep find
|
||||
|
||||
Help(){ # $1: optional message
|
||||
# Use: self, version
|
||||
|
@ -122,6 +122,7 @@ Check(){ # $1:filename
|
|||
done
|
||||
done <<<"$f"
|
||||
[[ $line ]] && Flag "Newline required at the end of a page" $n
|
||||
((examples>8)) && Flag "More than 8 examples"
|
||||
Ok "$examples Examples" $((flags-check+!examples))
|
||||
Ok "$B$1$XB" $flags
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue