Download third_party/ktx-src/scripts/gk from kimjunhan/vkgs-sim: direct link, hf CLI and curl.
- Browser
- Download file 1.38 kB
-
https://huggingface.co/kimjunhan/vkgs-sim/resolve/main/third_party/ktx-src/scripts/gk
- Command line
-
hf download hf://kimjunhan/vkgs-sim/third_party/ktx-src/scripts/gk
-
curl -L -o gk https://huggingface.co/kimjunhan/vkgs-sim/resolve/main/third_party/ktx-src/scripts/gk
1.38 kB
| # Copyright 2024, Mark Callow | |
| # SPDX-License-Identifier: Apache-2.0 | |
| # gk: grep in ktx software | |
| # Depth of this script relative to the project root | |
| depth=.. | |
| usage() { | |
| echo "Usage: $0 [--help,-h] [--filepattern,-f <filename pattern>] [<match pattern>]" | |
| echo " <filename pattern> defaults to '*' if no -f." | |
| echo " With no <match pattern> prints names of files matching <filename pattern>." | |
| exit $1 | |
| } | |
| while [ $# -ne 0 ]; do | |
| case $1 in | |
| --help | -h) | |
| usage 0 | |
| ;; | |
| --filepattern | -f) | |
| if [ $# -lt 1 ]; then | |
| usage 1 | |
| else | |
| filepattern=$2 | |
| shift 2 | |
| fi | |
| ;; | |
| --*) | |
| usage 1 | |
| ;; | |
| *) | |
| break | |
| ;; | |
| esac | |
| done | |
| if [ -z "$filepattern" -a $# -eq 0 ]; then | |
| usage 1 | |
| fi | |
| if [ $# -eq 1 ]; then | |
| match=$1 | |
| elif [ $# -gt 1 ]; then | |
| usage 1 | |
| elif [ -z "$filepattern" ]; then | |
| usage 1 | |
| fi | |
| if [ -z "$filepattern" ]; then | |
| filepattern='*' | |
| fi | |
| # Make sure we're in the KTX root directory | |
| cd $(dirname $0)/$depth | |
| if [ -n "$match" ]; then | |
| find . -path './build*' -prune -o -path tests/cts -prune -o -path './.git' -prune -o -path './external' -prune -o -type f -name "$filepattern" -exec grep -H "$match" {} \; | |
| else | |
| find . -path './build*' -prune -o -path tests/cts -prune -o -path './.git' -prune -o -path './external' -prune -o -type f -name "$filepattern" -print | |
| fi | |