Skip to content

Commit 0bdc78f

Browse files
authored
chore: 3.4.1 release, fallback to common if page doesn't exist on platform (#284)
1 parent 915826d commit 0bdc78f

File tree

3 files changed

+25
-11
lines changed

3 files changed

+25
-11
lines changed

CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Changelog
22

3+
## 3.4.1 (04/29/2025)
4+
5+
### Bugfixes
6+
7+
* Fix manpage path in `pyproject.toml` (thanks [@kbdharun](https://github.com/kbdharun))
8+
9+
### Features
10+
11+
* Fallback to `common` if a platform is specified using `-p` flag, but a page doesn't exist for that platform (thanks [@kbdharun](https://github.com/kbdharun))
12+
313
## 3.4.0 (03/28/2025)
414

515
### Breaking

docs/man/tldr.1

+10-10
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
2727
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
2828
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
2929
..
30-
.TH "TLDR" "1" "Mar 28, 2025" "" "tldr"
30+
.TH "TLDR" "1" "Apr 29, 2025" "" "tldr"
3131
.SH NAME
32-
tldr \- tldr 3.4.0
32+
tldr \- tldr 3.4.1
3333
.sp
3434
Python command line client for tldr
3535

@@ -59,12 +59,12 @@ Search for a specific command from a query
5959
.B \-u, \-\-update, \-\-update_cache
6060
Update the local cache of pages and exit
6161
.sp
62-
Default: False
62+
Default: \fBFalse\fP
6363
.TP
6464
.B \-k, \-\-clear\-cache
6565
Delete the local cache of pages and exit
6666
.sp
67-
Default: False
67+
Default: \fBFalse\fP
6868
.TP
6969
.B \-p, \-\-platform
7070
Possible choices: android, freebsd, linux, netbsd, openbsd, osx, sunos, windows, common
@@ -74,38 +74,38 @@ Override the operating system [android, freebsd, linux, netbsd, openbsd, osx, su
7474
.B \-l, \-\-list
7575
List all available commands for operating system
7676
.sp
77-
Default: False
77+
Default: \fBFalse\fP
7878
.TP
7979
.B \-s, \-\-source
8080
Override the default page source
8181
.sp
82-
Default: \(dq\X'tty: link https://raw.githubusercontent.com/tldr-pages/tldr/main/pages'\fI\%https://raw.githubusercontent.com/tldr\-pages/tldr/main/pages\fP\X'tty: link'\(dq
82+
Default: \fB\(aqhttps://raw.githubusercontent.com/tldr\-pages/tldr/main/pages\(aq\fP
8383
.TP
8484
.B \-c, \-\-color
8585
Override color stripping
8686
.TP
8787
.B \-r, \-\-render
8888
Render local markdown files
8989
.sp
90-
Default: False
90+
Default: \fBFalse\fP
9191
.TP
9292
.B \-L, \-\-language
9393
Override the default language
9494
.TP
9595
.B \-m, \-\-markdown
9696
Just print the plain page file.
9797
.sp
98-
Default: False
98+
Default: \fBFalse\fP
9999
.TP
100100
.B \-\-short\-options
101101
Display shortform options over longform
102102
.sp
103-
Default: False
103+
Default: \fBFalse\fP
104104
.TP
105105
.B \-\-long\-options
106106
Display longform options over shortform
107107
.sp
108-
Default: False
108+
Default: \fBFalse\fP
109109
.TP
110110
.B \-\-print\-completion
111111
Possible choices: bash, zsh, tcsh

tldr.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import shtab
1919
import shutil
2020

21-
__version__ = "3.4.0"
21+
__version__ = "3.4.1"
2222
__client_specification__ = "2.3"
2323

2424
REQUEST_HEADERS = {'User-Agent': 'tldr-python-client'}
@@ -251,6 +251,10 @@ def get_page_for_every_platform(
251251
"""Gives a list of tuples result-platform ordered by priority."""
252252
if platforms is None:
253253
platforms = get_platform_list()
254+
else:
255+
# When platform is explicitly specified, ensure 'common' is included as fallback
256+
if 'common' not in platforms and len(platforms) > 0:
257+
platforms = platforms + ['common']
254258
if languages is None:
255259
languages = get_language_list()
256260
# only use cache

0 commit comments

Comments
 (0)