Commit graph

385 commits

Author SHA1 Message Date
Danilo Bargen
81c30bfb77 Release v1.5.0 v1.5.0 2021-12-31 23:04:51 +01:00
Danilo Bargen
20b7c5c33f Run cargo update 2021-12-31 18:53:56 +01:00
Danilo Bargen
0ebf5aca87
Merge pull request #240 from dbrgn/ci-release
Release with GitHub Workflow
2021-12-31 18:28:54 +01:00
Danilo Bargen
d1c17f2eb6 Remove release-build.sh
We don't need it anymore now that we have a CI pipeline for release
binaries.
2021-12-31 18:20:17 +01:00
Danilo Bargen
c155b6f98d CI: Clean up release workflow and upload script
- Clean up scripts
- Create draft release before uploading assets
- Find release for current tag, don't simply pick the latest
- Add Windows builds
- Add checksums for binaries
2021-12-31 17:56:03 +01:00
alstjr7375
2007aa0c32 CI: Add initial release workflow 2021-12-31 00:29:28 +01:00
Danilo Bargen
e722b4f92e
Rename main branch (#239) 2021-12-30 22:39:27 +01:00
Danilo Bargen
7e44095e63
Merge pull request #238 from dbrgn/181-page-patch-chain
Concatenate page and patch bytes before processing
2021-12-30 22:11:12 +01:00
Danilo Bargen
ed3d1ea9af Always add empty line before concatenating patch file 2021-12-30 21:09:37 +01:00
Danilo Bargen
2b1167f19b Update custom patches docs 2021-12-30 00:12:51 +01:00
Danilo Bargen
fb40974616 Cache: Add tests for PageLookupResult::reader
Co-authored-by: Dalton Maahs <dalton.maahs@yourbind.com>
2021-12-30 00:01:31 +01:00
Danilo Bargen
0ef31d1f17 Concatenate page and patch bytes before processing
This way a patch file does not need a well-formed header anymore.

Fixes #181.
2021-12-30 00:01:31 +01:00
Danilo Bargen
0d1300c218
Merge pull request #236 from dbrgn/custom-pages-in-show-paths
Custom pages in show paths
2021-12-29 22:38:05 +01:00
Danilo Bargen
bbac67dd29
Merge pull request #237 from dbrgn/improved-docs
Improve docs.

Fixes #235, refs #218.
2021-12-24 21:56:17 +01:00
Danilo Bargen
ca844b35e9 Docs: Document custom pages and patches 2021-12-20 01:05:24 +01:00
Danilo Bargen
abeb5c3757 Docs: Add directories config section 2021-12-20 01:05:24 +01:00
Danilo Bargen
66255219fa Docs: Improve structure of config docs 2021-12-20 01:05:21 +01:00
Danilo Bargen
6508ec6ac6 Ensure that default custom_pages_dir ends with trailing slash 2021-12-20 00:26:19 +01:00
Danilo Bargen
00ec281b9b Include custom pages directory in --show-paths command 2021-12-20 00:25:48 +01:00
Danilo Bargen
f8785fbc3e
Merge pull request #233 from dbrgn/updates
Update dependencies
2021-12-11 19:22:00 +01:00
Danilo Bargen
876f390ac6 Clap: Enable colored error messages 2021-12-11 18:00:19 +01:00
Danilo Bargen
b726840246 Run cargo update 2021-12-11 18:00:19 +01:00
Danilo Bargen
69f4808214 Clap: Hide deprecated -o/--os argument from help 2021-12-11 18:00:19 +01:00
Danilo Bargen
25d771778a Update clap to 3.0.0-rc.4 2021-12-11 17:36:28 +01:00
Danilo Bargen
1a3624d011
Introduce command_or_file arg group (#230)
This allows to say "this command line parameter requires either a
command or a raw file".

Fixes #219.
2021-12-05 20:45:35 +01:00
Danilo Bargen
72d753c52b
Add "macos" alias for "osx" (#215)
The Apple computer operating system was renamed from "OS X" to "macOS"
in 2016. We should accept "macos" instead of "osx" in all our CLI APIs,
and the docs should also mention this alias instead of "osx".

For backwards compatibility and for compatibility with the tldr client
specification, we should still accept "osx" though.
2021-12-05 16:38:35 +01:00
Danilo Bargen
023a9d2079
Lowercase page names before lookup (#227) 2021-12-05 14:31:03 +01:00
Danilo Bargen
02a395ad13
Remove last traces of short -p pager flag (#228)
I missed some occurrences in #217.
2021-12-05 14:15:49 +01:00
Danilo Bargen
2684727eaa
Add helper functions: print_warning / print_error (#223)
These functions prepend a consistend prefix and they also use colors
(when enabled).

Messages are written to stderr.
2021-12-05 14:00:59 +01:00
Danilo Bargen
0fbc95cb71
Rename -o / --os to -p / --platform (#217)
This makes it compliant with the client spec.

The `-p` flag was previously used for the pager, using the pager now
requires using the long flag (`--pager`). Alternatively the pager can be
configured through the config file.

This commit also renames OsType to PlatformType.
2021-12-05 13:28:58 +01:00
Danilo Bargen
02c2d6709a
Run cargo update (#226)
This fixes a vulnerability in tokio (RUSTSEC-2021-0124).
2021-12-04 21:47:58 +01:00
Danilo Bargen
9c90f8ba7a
Fix clippy lints added in 1.57 (#225) 2021-12-04 21:34:06 +01:00
Danilo Bargen
746d4dadda
Fix clippy warnings (#222)
- Silence warning about excessive bools
- Implement recommendation about unneeded Option in return type
2021-10-24 23:30:10 +02:00
Marcin Puc
3beed4ad48
Simplify clap derive definition (#221)
- Use `possible_values`
- Change `render` field type to `PathBuf`
- Add comment about explicit field names
2021-10-24 23:17:43 +02:00
Danilo Bargen
cea3bcdc3f
Update benchmarks (#216)
New numbers with clap instead of docopt (current master branch). This
change improved performance considerably.
2021-10-18 00:21:43 +02:00
Danilo Bargen
c6bc6f8183
Merge pull request #108 from dbrgn/clap
Argument parsing: Switch from docopt to clap

Fixes #106.
2021-10-17 22:35:55 +02:00
Danilo Bargen
618ecaf71f Add @niklasmohrin to crate authors 2021-10-17 22:23:35 +02:00
Danilo Bargen
371f1d2ace Help: Add a link to the online docs 2021-10-17 22:22:45 +02:00
Danilo Bargen
6823e271a0 Disable clap colors for now
May be re-introduced if clap adds a `DisableColoredHelp` setting.

Relevant discussion:

- https://github.com/clap-rs/clap/pull/2845#issuecomment-945185102
- https://github.com/dbrgn/tealdeer/pull/108#issuecomment-945182471
2021-10-17 22:10:08 +02:00
Danilo Bargen
fc726011d1 Move free-standing get_os function to OsType::current 2021-10-17 21:16:50 +02:00
Danilo Bargen
8833b6b401 Rename -m / --markdown to -r / --raw
That flag name is clearer: We output raw page data without processing.
2021-10-17 21:12:08 +02:00
Danilo Bargen
ee0d32d3de CI: Ensure that usage string is always up to date 2021-10-17 21:12:08 +02:00
Danilo Bargen
6d77483ad5 Implement Default for ColorOptions 2021-10-17 21:12:08 +02:00
Danilo Bargen
5ad7dcfa34 Argument parsing: Switch from docopt to clap 2021-10-17 21:12:08 +02:00
Danilo Bargen
6300b6a24f
Merge pull request #214 from dbrgn/remove-udeps
Remove unused dependencies
2021-10-17 19:48:05 +02:00
Danilo Bargen
84227937ae Remove some optional zip features
By getting rid of the bzip2 and time features, we reduce the number of
dependencies. The official tldr pages archive uses deflate compression,
so that should be sufficient.
2021-10-16 20:40:40 +02:00
Danilo Bargen
0ebd727a32 Remove tar dependency
It's unused since #213.
2021-10-16 20:36:53 +02:00
Danilo Bargen
f7da0b028d Merge pull request #213 from invakid404/use-proper-tldr-archive
Download tldr pages from proper archive URL.
2021-10-16 20:10:00 +02:00
invakid404
62725fca5f When clearing cache, only delete pages, not entire cache dir
Squashed commits:

- chore: wipe only pages instead of entire cache dir
- fix: only delete dir if it exists
- chore: try to make variable names less confusing
- chore: display error as well
2021-10-16 20:09:32 +02:00
invakid404
006ec6f3c0 Switch to recommended tldr-pages archive URL
Instead of downloading the GitHub repository archive, download the pages
from the official URL instead.

Squashed commits:

- chore: use recommended tldr-pages archive url
- chore: extract pages dir to constant
- chore(deps): install zip crate
- feat: use zip crate to unpack archive
- chore(deps): drop flate2
2021-10-16 20:09:32 +02:00