mirror of
https://github.com/tealdeer-rs/tealdeer.git
synced 2026-08-09 09:49:10 +02:00
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.
This commit is contained in:
parent
023a9d2079
commit
72d753c52b
6 changed files with 11 additions and 11 deletions
|
|
@ -14,7 +14,7 @@ _tealdeer()
|
|||
return
|
||||
;;
|
||||
-p|--platform)
|
||||
COMPREPLY=( $(compgen -W 'linux osx sunos windows' -- "${cur}") )
|
||||
COMPREPLY=( $(compgen -W 'linux macos sunos windows' -- "${cur}") )
|
||||
return
|
||||
;;
|
||||
--color)
|
||||
|
|
|
|||
|
|
@ -13,10 +13,9 @@ ARGS:
|
|||
OPTIONS:
|
||||
-l, --list List all commands in the cache
|
||||
-f, --render <FILE> Render a specific markdown file
|
||||
-p, --platform <PLATFORM> Override the operating system [possible values: linux, osx, sunos,
|
||||
windows]
|
||||
-o, --os <OS> Deprecated alias of `platform` [possible values: linux, osx, sunos,
|
||||
windows]
|
||||
-p, --platform <PLATFORM> Override the operating system [possible values: linux, macos,
|
||||
windows, sunos, osx]
|
||||
-o, --os <OS> Deprecated alias of `platform`
|
||||
-L, --language <LANGUAGE> Override the language
|
||||
-u, --update Update the local cache
|
||||
-c, --clear-cache Clear the local cache
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ complete -c tldr -s h -l help -d 'Print the help message.' -f
|
|||
complete -c tldr -s v -l version -d 'Show version information.' -f
|
||||
complete -c tldr -s l -l list -d 'List all commands in the cache.' -f
|
||||
complete -c tldr -s f -l render -d 'Render a specific markdown file.' -r
|
||||
complete -c tldr -s p -l platform -d 'Override the operating system.' -xa 'linux osx sunos windows'
|
||||
complete -c tldr -s p -l platform -d 'Override the operating system.' -xa 'linux macos sunos windows'
|
||||
complete -c tldr -s u -l update -d 'Update the local cache.' -f
|
||||
complete -c tldr -s c -l clear-cache -d 'Clear the local cache.' -f
|
||||
complete -c tldr -s p -l pager -d 'Use a pager to page output.' -f
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ struct Args {
|
|||
short = 'p',
|
||||
long = "platform",
|
||||
requires = "command",
|
||||
possible_values = ["linux", "osx", "sunos", "windows"],
|
||||
possible_values = ["linux", "macos", "windows", "sunos", "osx"],
|
||||
)]
|
||||
platform: Option<PlatformType>,
|
||||
|
||||
|
|
@ -93,7 +93,8 @@ struct Args {
|
|||
short = 'o',
|
||||
long = "os",
|
||||
requires = "command",
|
||||
possible_values = ["linux", "osx", "sunos", "windows"],
|
||||
possible_values = ["linux", "macos", "windows", "sunos", "osx"],
|
||||
hide_possible_values = true,
|
||||
)]
|
||||
os: Option<PlatformType>,
|
||||
|
||||
|
|
|
|||
|
|
@ -31,11 +31,11 @@ impl str::FromStr for PlatformType {
|
|||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||
match s {
|
||||
"linux" => Ok(Self::Linux),
|
||||
"osx" => Ok(Self::OsX),
|
||||
"osx" | "macos" => Ok(Self::OsX),
|
||||
"sunos" => Ok(Self::SunOs),
|
||||
"windows" => Ok(Self::Windows),
|
||||
other => Err(format!(
|
||||
"Unknown OS: {}. Possible values: linux, osx, sunos, windows",
|
||||
"Unknown OS: {}. Possible values: linux, macos, osx, sunos, windows",
|
||||
other
|
||||
)),
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ _tealdeer() {
|
|||
"($I -f --render)"{-f,--render}"[Render a specific markdown file]:file:_files"
|
||||
"($I -p --platform)"{-p,--platform}'[Override the operating system]:platform:((
|
||||
linux
|
||||
osx
|
||||
macos
|
||||
sunos
|
||||
windows
|
||||
))'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue