Use which instead of tar as reference tldr page in tests (#192)

The page for `tar` changes pretty frequently. `which` was last updated in 2018 and is a rather simple command overall. So it is less likely that the reference in the repository has to be updated as often as the one for `tar`.
This commit is contained in:
Danny Mösch 2021-05-13 14:12:11 +02:00 committed by GitHub
commit b6342633cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 43 deletions

View file

@ -284,12 +284,12 @@ fn test_os_specific_page() {
fn test_markdown_rendering() {
let testenv = TestEnv::new();
testenv.add_entry("tar", include_str!("tar-markdown.expected"));
testenv.add_entry("which", include_str!("which-markdown.expected"));
let expected = include_str!("tar-markdown.expected");
let expected = include_str!("which-markdown.expected");
testenv
.command()
.args(&["-m", "tar"])
.args(&["-m", "which"])
.assert()
.success()
.stdout(similar(expected));
@ -427,7 +427,7 @@ fn test_pager_flag_enable() {
testenv
.command()
.args(&["--pager", "tar"])
.args(&["--pager", "which"])
.assert()
.success();
}
@ -618,7 +618,7 @@ fn test_pager_warning() {
// Regular call should not show a "pager flag not available on windows" warning
testenv
.command()
.args(&["tar"])
.args(&["which"])
.assert()
.success()
.stderr(contains("pager flag not available on Windows").not());
@ -626,7 +626,7 @@ fn test_pager_warning() {
// But it should be shown if the pager flag is true
testenv
.command()
.args(&["tar", "-p"])
.args(&["which", "-p"])
.assert()
.success()
.stderr(contains("pager flag not available on Windows"));

View file

@ -1,37 +0,0 @@
# tar
> Archiving utility.
> Often combined with a compression method, such as gzip or bzip2.
> More information: <https://www.gnu.org/software/tar>.
- [c]reate an archive and write it to a [f]ile:
`tar cf {{target.tar}} {{file1}} {{file2}} {{file3}}`
- [c]reate a g[z]ipped archive and write it to a [f]ile:
`tar czf {{target.tar.gz}} {{file1}} {{file2}} {{file3}}`
- [c]reate a g[z]ipped archive from a directory using relative paths:
`tar czf {{target.tar.gz}} --directory={{path/to/directory}} .`
- E[x]tract a (compressed) archive [f]ile into the current directory [v]erbosely:
`tar xvf {{source.tar[.gz|.bz2|.xz]}}`
- E[x]tract a (compressed) archive [f]ile into the target directory:
`tar xf {{source.tar[.gz|.bz2|.xz]}} --directory={{directory}}`
- [c]reate a compressed archive and write it to a [f]ile, using [a]rchive suffix to determine the compression program:
`tar caf {{target.tar.xz}} {{file1}} {{file2}} {{file3}}`
- Lis[t] the contents of a tar [f]ile [v]erbosely:
`tar tvf {{source.tar}}`
- E[x]tract files matching a pattern from an archive [f]ile:
`tar xf {{source.tar}} --wildcards "{{*.html}}"`

View file

@ -0,0 +1,11 @@
# which
> Locate a program in the user's path.
- Search the PATH environment variable and display the location of any matching executables:
`which {{executable}}`
- If there are multiple executables which match, display all:
`which -a {{executable}}`