Add support for new windows platform. Closes #6

This commit is contained in:
anandsudhir 2017-12-05 13:54:51 +01:00
parent 4f117c180b
commit cc2052e943
1 changed files with 5 additions and 3 deletions

8
tldr
View File

@ -55,7 +55,7 @@ Usage(){
$HDE[${HPL}platform$XHPL/]${HCO}command$XHCO: Show page for ${HCO}command$XHCO (from ${HPL}platform$XHPL)
${HPL}platform$XHPL (optional) one of: ${HPL}common$XHPL, ${HPL}linux$XHPL, ${HPL}osx$XHPL, ${HPL}sunos$XHPL, ${HPL}current$XHPL (includes common)
${HPL}platform$XHPL (optional) one of: ${HPL}common$XHPL, ${HPL}linux$XHPL, ${HPL}osx$XHPL, ${HPL}sunos$XHPL, ${HPL}windows$XHPL, ${HPL}current$XHPL (includes common)
${HOP}option$XHOP is optionally one of:
$HOP-s$XHOP, $HOP--search$XHOP ${HFI}regex$XHFI: Search for ${HFI}regex$XHFI in all tldr pages
@ -190,6 +190,8 @@ Config(){
Darwin) os='osx' ;;
Linux) os='linux' ;;
SunOS) os='sunos' ;;
CYGWIN*) os='windows' ;;
MINGW*) os='windows' ;;
esac
Init_term
[[ $TLDR_LESS = 0 ]] &&
@ -402,7 +404,7 @@ Main(){
Find_regex "$2" "$err" ;;
-l|--list) [[ $2 ]] && {
platform=$2
[[ ,common,linux,osx,sunos,current, != *,$platform,* ]] &&
[[ ,common,linux,osx,sunos,windows,current, != *,$platform,* ]] &&
Err "Unknown platform $I$platform$XI" && Usage 12
[[ $3 ]] && Err "$nomore" && err=13
}
@ -436,7 +438,7 @@ Main(){
[[ -z $page ]] && Err "No command specified" && Usage 24
[[ ${page:0:1} = '-' || $page = *' '-* ]] && Err "Only one option allowed" && Usage 25
[[ $page = */* ]] && platform=${page%/*} && page=${page##*/}
[[ $platform && ,common,linux,osx,sunos, != *,$platform,* ]] && {
[[ $platform && ,common,linux,osx,sunos,windows, != *,$platform,* ]] && {
Err "Unknown platform $I$platform$XI"
Usage 26
}