From 381261f987fc01029117795113ba172473a56259 Mon Sep 17 00:00:00 2001 From: "David A. Wheeler" Date: Wed, 2 Oct 2024 16:54:28 -0400 Subject: [PATCH] MInor fixups Signed-off-by: David A. Wheeler --- docs/labs/argument-injection.html | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/labs/argument-injection.html b/docs/labs/argument-injection.html index 4c104027..a9907ab5 100644 --- a/docs/labs/argument-injection.html +++ b/docs/labs/argument-injection.html @@ -18,7 +18,7 @@ \s* execFile \( ('git'|"git"|`git`) , \[ ('blame'|"blame"|`blame`) , ('--'|"--"|`--`) , filePath \] , - (\{ shell : false \} ,)? + (\{ (shell : false)? \} ,)? \( [a-zA-Z_$][a-zA-Z0-9_$]* , [a-zA-Z_$][a-zA-Z0-9_$]* , [a-zA-Z_$][a-zA-Z0-9_$]* \) => \{ \s* @@ -52,6 +52,13 @@ text: > Pass the arguments as an array, like this: `execFile('git', ['blame', ...])`. +- present: |- + -- + absent: |- + ['"\`]--['"`] + text: > + To pass `--` you need to pass it as a constant string. Typically this + is notated as `'--'` or `"--"`. - absent: |- \[ ['"\`]blame['"`] , ['"\`]--['"`] , text: > @@ -122,6 +129,8 @@ - " execFile('git', ['blame', '--', filePath], { shell: false }, (error, stdout, stderr) => {" # Allow omitting shell:false since that is the default - " execFile('git', ['blame', '--', filePath], (error, stdout, stderr) => {" + # Allow empty options, since shell:false is the default + - " execFile('git', ['blame', '--', filePath], {}, (error, stdout, stderr) => {" failures: # Using exec instead of execFile - @@ -207,7 +216,7 @@

Task Information

Here are some hints: