grep

    grep command for MoonX.

    command-line
    moonx
    wasm
    Download zip
    Author
    Version
    0.3.2
    License
    Apache-2.0
    Last updated
    9 days ago
    Downloads
    116

    #grep

    Search text patterns for MoonX.

    moonx cli/grep@0.3.2 [-EFGivnclLqHhxwrRbszo] [-A NUM] [-B NUM] [-C NUM] [--include=GLOB] [--exclude=GLOB] [--binary-files=TYPE] [-e PATTERN] [-f FILE] [PATTERN] [FILE...]

    #Supported scope

    Search files or stdin with basic/extended regular expressions or fixed strings, including context, counts and recursive traversal. Exit 0 for a match, 1 for no match and 2 for errors.

    #Options

    OptionDescription
    -E / -F / -GExtended regex / fixed strings / basic regex (default).
    -e PATTERN / -f FILEAdd patterns directly / from a file.
    -i / -v / -x / -wIgnore ASCII case / invert / whole record / whole word.
    -n / -b / -oShow record numbers / byte offsets / nonempty matches.
    -c / -l / -L / -qCounts / matching filenames / nonmatching filenames / status only.
    -H / -hAlways / never show filenames.
    -A N / -B N / -C NAfter / before / surrounding context.
    -r / -RRecurse without following links.
    --include=GLOB / --exclude=GLOBFilter recursive basenames using * and ?.
    -a / --binary-files=TYPEBinary policy: binary, text or without-match.
    -sSuppress file-read diagnostics.
    -zUse NUL-delimited records.
    --help / --versionShow help / package version.

    #Limitations

    • Matching and case folding use C-byte rules; locale collation and multibyte case folding are unsupported.
    • Recursive -r and -R do not follow symbolic links.
    • Empty-pattern -v -c prints 0; GNU grep 3.12 emits no stdout in that case. Both exit 1.

    #Examples

    moonx cli/grep@0.3.2 -n 'TODO' notes.txt moonx cli/grep@0.3.2 -r -F -e TODO -e FIXME src