Skip to content

Commit

Permalink
Added search, small improvements
Browse files Browse the repository at this point in the history
Added an option to search for a string in all pages. Improved argument
handling to be more in line with other tools. Improved cache checking to
mitigate errors created by a corrupt cache. Reformatted parts of the
code.

Signed-off-by: Arthur Bols <[email protected]>
  • Loading branch information
principis committed Jun 24, 2019
1 parent ec15cdc commit 064f8a6
Show file tree
Hide file tree
Showing 4 changed files with 256 additions and 118 deletions.
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,21 @@ Extract the dll in the same folder as tldr_sharp.exe.
```
Usage: tldr command [options]
Simplified and community-driven man pages
-h, --help Display this help text.
-l, --list Show all pages for the current platform
-a, --list-all Show all pages
-u, --update Update the local cache.
-c, --clear-cache Clear the local cache.
--os=VALUE Override the default OS
-a, --list-all List all pages
-c, --clear-cache Clear the local cache
-f, --render=VALUE Render a specific markdown file
-h, --help Display this help text
-l, --list List all pages for the current platform and
language
--list-os List all OS's
--lang=VALUE Override the default language
--list-languages List all languages
--lang=VALUE Override the default language
-m, --markdown Show the markdown source of a page
-p, --platform=VALUE Override the default OS
-s, --search=VALUE Search for a string.
-u, --update Update the local cache.
--self-update Check for tldr-sharp updates.
-v, --version Show version information.
```

## License
Expand Down
24 changes: 20 additions & 4 deletions scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ if [ $? == 0 ]; then
fi

# test os
mono tldr_sharp.exe tldr --platform=linux >/dev/null
mono tldr_sharp.exe --platform=linux >/dev/null
if [ $? != 0 ]; then
exit 1
fi
Expand All @@ -90,20 +90,36 @@ if [ $? == 0 ]; then
fi

# Test list-languages
mono tldr_sharp.exe tldr --list-languages >/dev/null
mono tldr_sharp.exe --list-languages >/dev/null
if [ $? != 0 ]; then
exit 1
fi

# Test list-os
mono tldr_sharp.exe tldr --list-os >/dev/null
mono tldr_sharp.exe --list-os >/dev/null
if [ $? != 0 ]; then
exit 1
fi

# Test version
mono tldr_sharp.exe tldr -v >/dev/null
mono tldr_sharp.exe -v >/dev/null
if [ $? != 0 ]; then
exit 1
fi

# Test search
mono tldr_sharp.exe -s tar >/dev/null
if [ $? != 0 ]; then
exit 1
fi

mono tldr_sharp.exe -s giberishdsfsd >/dev/null
if [ $? == 0 ]; then
exit 1
fi

# Test self-update
mono tldr_sharp.exe --self-update >/dev/null
if [ $? != 0 ]; then
exit 1
fi
Loading

0 comments on commit 064f8a6

Please sign in to comment.