import { shellExpand } from "https://deno.land/x/dxx@rf/src/lib/xArgs.ts";
'shell'-expand argument string(s).
- Performs
bash
-like expansion (compatible with the Bash v4.3 specification). - Quotes (single or double) are used to protect braces, tildes, and globs from expansion; unbalanced quotes are allowed (and parsed as if completed by the end of the string).
- Character escape sequences are not recognized/supported.
- Brace expansion is fully implemented (including nested braces and "brace bomb" protections).
- Glob expansion supports
globstar
and full extended glob syntax.
Examples
Example 1
Example 1
const expansion: string[] = await shellExpandAsync('{.,}'); // or `shellExpand(['{.,}*', './src/file_{1..10..2}_*.ts'])`
Parameters
optional
options: ArgsOptions = [UNSUPPORTED]