|
| 1 | +/* IMPORTANT |
| 2 | + * This snapshot file is auto-generated, but designed for humans. |
| 3 | + * It should be checked into source control and tracked carefully. |
| 4 | + * Re-generate by setting TAP_SNAPSHOT=1 and running tests. |
| 5 | + * Make sure to inspect the output below. Do not ignore changes! |
| 6 | + */ |
| 7 | +'use strict' |
| 8 | +exports[`test/bin.ts TAP usage > -h shows usage 1`] = ` |
| 9 | +Object { |
| 10 | + "args": Array [ |
| 11 | + "-h", |
| 12 | + ], |
| 13 | + "code": 0, |
| 14 | + "options": Object {}, |
| 15 | + "signal": null, |
| 16 | + "stderr": "", |
| 17 | + "stdout": String( |
| 18 | + Usage: |
| 19 | + glob [options] [<pattern> [<pattern> ...]] |
| 20 | + |
| 21 | + Glob v10.2.7 |
| 22 | + |
| 23 | + Expand the positional glob expression arguments into any matching file system |
| 24 | + paths found. |
| 25 | + |
| 26 | + -c<command> --cmd=<command> |
| 27 | + Run the command provided, passing the glob expression |
| 28 | + matches as arguments. |
| 29 | + |
| 30 | + -p<pattern> --default=<pattern> |
| 31 | + If no positional arguments are provided, glob will use |
| 32 | + this pattern |
| 33 | + |
| 34 | + -A --all By default, the glob cli command will not expand any |
| 35 | + arguments that are an exact match to a file on disk. |
| 36 | + |
| 37 | + This prevents double-expanding, in case the shell |
| 38 | + expands an argument whose filename is a glob |
| 39 | + expression. |
| 40 | + |
| 41 | + For example, if 'app/*.ts' would match 'app/[id].ts', |
| 42 | + then on Windows powershell or cmd.exe, 'glob app/*.ts' |
| 43 | + will expand to 'app/[id].ts', as expected. However, in |
| 44 | + posix shells such as bash or zsh, the shell will first |
| 45 | + expand 'app/*.ts' to a list of filenames. Then glob |
| 46 | + will look for a file matching 'app/[id].ts' (ie, |
| 47 | + 'app/i.ts' or 'app/d.ts'), which is unexpected. |
| 48 | + |
| 49 | + Setting '--all' prevents this behavior, causing glob to |
| 50 | + treat ALL patterns as glob expressions to be expanded, |
| 51 | + even if they are an exact match to a file on disk. |
| 52 | + |
| 53 | + When setting this option, be sure to enquote arguments |
| 54 | + so that the shell will not expand them prior to passing |
| 55 | + them to the glob command process. |
| 56 | + |
| 57 | + -a --absolute Expand to absolute paths |
| 58 | + -d --dot-relative Prepend './' on relative matches |
| 59 | + -m --mark Append a / on any directories matched |
| 60 | + -x --posix Always resolve to posix style paths, using '/' as the |
| 61 | + directory separator, even on Windows. Drive letter |
| 62 | + absolute matches on Windows will be expanded to their |
| 63 | + full resolved UNC maths, eg instead of 'C:\\\\foo\\\\bar', it |
| 64 | + will expand to '//?/C:/foo/bar'. |
| 65 | + |
| 66 | + -f --follow Follow symlinked directories when expanding '**' |
| 67 | + -R --realpath Call 'fs.realpath' on all of the results. In the case |
| 68 | + of an entry that cannot be resolved, the entry is |
| 69 | + omitted. This incurs a slight performance penalty, of |
| 70 | + course, because of the added system calls. |
| 71 | + |
| 72 | + -s --stat Call 'fs.lstat' on all entries, whether required or not |
| 73 | + to determine if it's a valid match. |
| 74 | + |
| 75 | + -b --match-base Perform a basename-only match if the pattern does not |
| 76 | + contain any slash characters. That is, '*.js' would be |
| 77 | + treated as equivalent to '**/*.js', matching js files |
| 78 | + in all directories. |
| 79 | + |
| 80 | + --dot Allow patterns to match files/directories that start |
| 81 | + with '.', even if the pattern does not start with '.' |
| 82 | + |
| 83 | + --nobrace Do not expand {...} patterns |
| 84 | + --nocase Perform a case-insensitive match. This defaults to |
| 85 | + 'true' on macOS and Windows platforms, and false on all |
| 86 | + others. |
| 87 | + |
| 88 | + Note: 'nocase' should only be explicitly set when it is |
| 89 | + known that the filesystem's case sensitivity differs |
| 90 | + from the platform default. If set 'true' on |
| 91 | + case-insensitive file systems, then the walk may return |
| 92 | + more or less results than expected. |
| 93 | + |
| 94 | + --nodir Do not match directories, only files. |
| 95 | + |
| 96 | + Note: to *only* match directories, append a '/' at the |
| 97 | + end of the pattern. |
| 98 | + |
| 99 | + --noext Do not expand extglob patterns, such as '+(a|b)' |
| 100 | + --noglobstar Do not expand '**' against multiple path portions. Ie, |
| 101 | + treat it as a normal '*' instead. |
| 102 | + |
| 103 | + --windows-path-no-escape |
| 104 | + Use '\\\\' as a path separator *only*, and *never* as an |
| 105 | + escape character. If set, all '\\\\' characters are |
| 106 | + replaced with '/' in the pattern. |
| 107 | + |
| 108 | + -D<n> --max-depth=<n> Maximum depth to traverse from the current working |
| 109 | + directory |
| 110 | + |
| 111 | + -C<cwd> --cwd=<cwd> Current working directory to execute/match in |
| 112 | + -r<root> --root=<root> A string path resolved against the 'cwd', which is used |
| 113 | + as the starting point for absolute patterns that start |
| 114 | + with '/' (but not drive letters or UNC paths on |
| 115 | + Windows). |
| 116 | + |
| 117 | + Note that this *doesn't* necessarily limit the walk to |
| 118 | + the 'root' directory, and doesn't affect the cwd |
| 119 | + starting point for non-absolute patterns. A pattern |
| 120 | + containing '..' will still be able to traverse out of |
| 121 | + the root directory, if it is not an actual root |
| 122 | + directory on the filesystem, and any non-absolute |
| 123 | + patterns will still be matched in the 'cwd'. |
| 124 | + |
| 125 | + To start absolute and non-absolute patterns in the same |
| 126 | + path, you can use '--root=' to set it to the empty |
| 127 | + string. However, be aware that on Windows systems, a |
| 128 | + pattern like 'x:/*' or '//host/share/*' will *always* |
| 129 | + start in the 'x:/' or '//host/share/' directory, |
| 130 | + regardless of the --root setting. |
| 131 | + |
| 132 | + --platform=<platform> Defaults to the value of 'process.platform' if |
| 133 | + available, or 'linux' if not. Setting --platform=win32 |
| 134 | + on non-Windows systems may cause strange behavior! |
| 135 | + |
| 136 | + -i<ignore> --ignore=<ignore> |
| 137 | + Glob patterns to ignore Can be set multiple times |
| 138 | + -v --debug Output a huge amount of noisy debug information about |
| 139 | + patterns as they are parsed and used to match files. |
| 140 | + |
| 141 | + -h --help Show this usage information |
| 142 | + |
| 143 | + ), |
| 144 | +} |
| 145 | +` |
0 commit comments