mirror of
https://github.com/eth-p/bat-extras.git
synced 2024-11-07 08:14:02 +01:00
add a test
This commit is contained in:
parent
762ac557f4
commit
f47d9c4138
0
test/snapshot/batgrep/test_help.stderr.snapshot
Normal file
0
test/snapshot/batgrep/test_help.stderr.snapshot
Normal file
104
test/snapshot/batgrep/test_help.stdout.snapshot
Normal file
104
test/snapshot/batgrep/test_help.stdout.snapshot
Normal file
@ -0,0 +1,104 @@
|
||||
Quickly search through and highlight files using ripgrep.
|
||||
|
||||
Search through files or directories looking for matching regular expressions (or fixed strings with -F), and print the output using bat for an easy and syntax-highlighted experience.
|
||||
|
||||
Usage: batgrep [OPTIONS] PATTERN [PATH...]
|
||||
|
||||
Arguments:
|
||||
[OPTIONS]
|
||||
See Options below
|
||||
PATTERN
|
||||
Pattern passed to ripgrep
|
||||
[PATH...]
|
||||
Path(s) to search
|
||||
|
||||
Options:
|
||||
-i, --ingore-case:
|
||||
Use case insensitive searching.
|
||||
|
||||
-s, --case-sensitive:
|
||||
Use case sensitive searching.
|
||||
|
||||
-S, --smart-case:
|
||||
Use smart case searching
|
||||
|
||||
-A, --after-context=[LINES]:
|
||||
Display the next n lines after a matched line.
|
||||
|
||||
-B, --before-context=[LINES]:
|
||||
Display the previous n lines before a matched line.
|
||||
|
||||
-C, --context=[LINES]:
|
||||
A combination of --after-context and --before-context
|
||||
|
||||
-p, --search-pattern:
|
||||
Tell pager to search for PATTERN. Currently supported pagers: less.
|
||||
|
||||
--no-follow:
|
||||
Do not follow symlinks
|
||||
|
||||
--no-snip:
|
||||
Do not show the snip decoration
|
||||
|
||||
This is automatically enabled when --context=0 or when bat --version is less than 0.12.x
|
||||
|
||||
--no-highlight:
|
||||
Do not highlight matching lines.
|
||||
|
||||
This is automatically enabled when --context=0.
|
||||
|
||||
--color:
|
||||
Force color output.
|
||||
|
||||
--no-color:
|
||||
Force disable color output.
|
||||
|
||||
--paging=["never"/"always"]:
|
||||
Enable/disable paging.
|
||||
|
||||
--pager=[PAGER]:
|
||||
Specify the pager to use.
|
||||
|
||||
--terminal-wdith=[COLS]:
|
||||
Generate output for the specified terminal width.
|
||||
|
||||
--no-seperator:
|
||||
Disable printing separator between files
|
||||
|
||||
Options passed directly to ripgrep:
|
||||
-F, --fixed-strings
|
||||
|
||||
-U, --multiline
|
||||
|
||||
-P, --pcre2
|
||||
|
||||
-z, --search-zip
|
||||
|
||||
-w, --word-regexp
|
||||
|
||||
--one-file-system
|
||||
|
||||
--multiline-dotall
|
||||
|
||||
--ignore, --no-ignore
|
||||
|
||||
--crlf, --no-crlf
|
||||
|
||||
--hidden, --no-hidden
|
||||
|
||||
-E --encoding:
|
||||
This is unsupported by bat, and may cause issues when trying to display unsupported encodings.
|
||||
|
||||
-g, --glob
|
||||
|
||||
-t, --type
|
||||
|
||||
-T, --type-not
|
||||
|
||||
-m, --max-count
|
||||
|
||||
--max-depth
|
||||
|
||||
--iglob
|
||||
|
||||
--ignore-file
|
@ -16,6 +16,15 @@ require_rg() {
|
||||
fi
|
||||
}
|
||||
|
||||
test:help() {
|
||||
description "Test 'batgrep --help'"
|
||||
snapshot stdout
|
||||
batgrep --help
|
||||
|
||||
assert batgrep --help
|
||||
batgrep --help | grep -q 'Usage'
|
||||
}
|
||||
|
||||
test:version() {
|
||||
description "Test 'batgrep --version'"
|
||||
snapshot stdout
|
||||
|
Loading…
Reference in New Issue
Block a user