diff options
| author | Weicao-CatilGrass <1992414357@qq.com> | 2026-06-12 20:23:09 +0800 |
|---|---|---|
| committer | Weicao-CatilGrass <1992414357@qq.com> | 2026-06-12 20:23:09 +0800 |
| commit | 834c2412fa6a795ff3bd793ad2bbb80e180a7702 (patch) | |
| tree | cdbe5ae928bac22fe2b1a12b5cff0838a584f36c /run-tools.sh | |
| parent | e94787a4f2633aee6578d54ad1bcbd97384634e4 (diff) | |
Pass through tool arguments to scripts and binaries
Diffstat (limited to 'run-tools.sh')
| -rwxr-xr-x | run-tools.sh | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/run-tools.sh b/run-tools.sh index d50ca48..9a68f0e 100755 --- a/run-tools.sh +++ b/run-tools.sh @@ -34,6 +34,7 @@ if [ $# -eq 0 ]; then fi target_bin="$1" +shift # Remove the first argument (tool name), keep the rest as tool arguments # Check if input is a number if [[ "$target_bin" =~ ^[0-9]+$ ]]; then @@ -52,11 +53,11 @@ target_file="dev_tools/src/bin/${target_bin}.rs" if [ -f "$target_script" ]; then chmod +x "$target_script" - "$target_script" + "$target_script" "$@" elif [ -f "$target_python" ]; then - python "$target_python" + python "$target_python" "$@" elif [ -f "$target_file" ]; then - cargo run --manifest-path dev_tools/Cargo.toml --bin "$target_bin" --quiet + cargo run --manifest-path dev_tools/Cargo.toml --bin "$target_bin" --quiet -- "$@" else echo "Error: target '$target_bin' does not exist" exit 1 |
