Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,27 +58,27 @@
"dependencies": {
"chalk": "4.1.2",
"rxjs": "7.8.2",
"shell-quote": "1.8.1",
"shell-quote": "1.8.3",
"supports-color": "8.1.1",
"tree-kill": "1.2.2",
"yargs": "17.7.2"
},
"devDependencies": {
"@eslint/js": "9.33.0",
"@eslint/js": "^9.33.0",
"@hirez_io/observer-spy": "^2.2.0",
"@types/node": "^18.19.123",
"@types/shell-quote": "^1.7.5",
"@types/supports-color": "^8.1.3",
"@types/yargs": "^17.0.33",
"@vitest/coverage-v8": "^3.2.4",
"@vitest/eslint-plugin": "1.3.4",
"@vitest/eslint-plugin": "^1.3.4",
"coveralls-next": "^5.0.0",
"ctrlc-wrapper": "^0.0.5",
"esbuild": "~0.25.9",
"eslint": "^9.33.0",
"eslint-config-flat-gitignore": "2.1.0",
"eslint-config-flat-gitignore": "^2.1.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-import-lite": "0.3.0",
"eslint-plugin-import-lite": "^0.3.0",
"eslint-plugin-prettier": "^5.5.4",
"eslint-plugin-simple-import-sort": "^12.1.1",
"globals": "16.3.0",
Expand All @@ -88,7 +88,7 @@
"safe-publish-latest": "^2.0.0",
"string-argv": "^0.3.2",
"typescript": "~5.9.2",
"typescript-eslint": "8.40.0",
"typescript-eslint": "^8.40.0",
"vitest": "^3.2.4"
},
"files": [
Expand Down
29 changes: 12 additions & 17 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 20 additions & 14 deletions src/command-parser/expand-arguments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,27 @@ export class ExpandArguments implements CommandParser {
if (match.startsWith('\\')) {
return match.slice(1);
}
// Replace numeric placeholder if value exists in additional arguments.
if (
!isNaN(placeholderTarget) &&
placeholderTarget <= this.additionalArguments.length
) {
return quote([this.additionalArguments[placeholderTarget - 1]]);
}
// Replace all arguments placeholder.
if (placeholderTarget === '@') {
return quote(this.additionalArguments);
}
// Replace combined arguments placeholder.
if (placeholderTarget === '*') {
return quote([this.additionalArguments.join(' ')]);

if (this.additionalArguments.length > 0) {
// Replace numeric placeholder if value exists in additional arguments.
if (
!isNaN(placeholderTarget) &&
placeholderTarget <= this.additionalArguments.length
) {
return quote([this.additionalArguments[placeholderTarget - 1]]);
}

// Replace all arguments placeholder.
if (placeholderTarget === '@') {
return quote(this.additionalArguments);
}

// Replace combined arguments placeholder.
if (placeholderTarget === '*') {
return quote([this.additionalArguments.join(' ')]);
}
}

// Replace placeholder with empty string
// if value doesn't exist in additional arguments.
return '';
Expand Down
Loading