summaryrefslogtreecommitdiff
path: root/bin/spack.bat
diff options
context:
space:
mode:
authorJohn W. Parent <45471568+johnwparent@users.noreply.github.com>2023-04-06 12:43:27 -0400
committerGitHub <noreply@github.com>2023-04-06 09:43:27 -0700
commit44e15da92cbdefdd345a9d5bd495010e85e1378b (patch)
treebbe27258a1bd55b360b8d31dff60e5ef6af7aa91 /bin/spack.bat
parent685dd7272a61ed57ee00dfe76b7f9b9d1ac6f9f7 (diff)
downloadspack-44e15da92cbdefdd345a9d5bd495010e85e1378b.tar.gz
spack-44e15da92cbdefdd345a9d5bd495010e85e1378b.tar.bz2
spack-44e15da92cbdefdd345a9d5bd495010e85e1378b.tar.xz
spack-44e15da92cbdefdd345a9d5bd495010e85e1378b.zip
Spack on Windows: spack.bat comment syntax (#36531)
Comments must start with `rem` in most cases.
Diffstat (limited to 'bin/spack.bat')
-rw-r--r--bin/spack.bat38
1 files changed, 19 insertions, 19 deletions
diff --git a/bin/spack.bat b/bin/spack.bat
index 2c2947ac0f..514c2706d7 100644
--- a/bin/spack.bat
+++ b/bin/spack.bat
@@ -60,28 +60,28 @@ setlocal enabledelayedexpansion
:: capture cl args in variable named cl_args
set cl_args=%*
:process_cl_args
-:: tokens=1* returns the first processed token produced
-:: by tokenizing the input string cl_args on spaces into
-:: the named variable %%g
-:: While this make look like a for loop, it only
-:: executes a single time for each of the cl args
-:: the actual iterative loop is performed by the
-:: goto process_cl_args stanza
-:: we are simply leveraging the "for" method's string
-:: tokenization
+rem tokens=1* returns the first processed token produced
+rem by tokenizing the input string cl_args on spaces into
+rem the named variable %%g
+rem While this make look like a for loop, it only
+rem executes a single time for each of the cl args
+rem the actual iterative loop is performed by the
+rem goto process_cl_args stanza
+rem we are simply leveraging the "for" method's string
+rem tokenization
for /f "tokens=1*" %%g in ("%cl_args%") do (
set t=%%~g
- :: remainder of string is composed into %%h
- :: these are the cl args yet to be processed
- :: assign cl_args var to only the args to be processed
- :: effectively discarding the current arg %%g
- :: this will be nul when we have no further tokens to process
+ rem remainder of string is composed into %%h
+ rem these are the cl args yet to be processed
+ rem assign cl_args var to only the args to be processed
+ rem effectively discarding the current arg %%g
+ rem this will be nul when we have no further tokens to process
set cl_args=%%h
- :: process the first space delineated cl arg
- :: of this iteration
+ rem process the first space delineated cl arg
+ rem of this iteration
if "!t:~0,1!" == "-" (
if defined _sp_subcommand (
- :: We already have a subcommand, processing args now
+ rem We already have a subcommand, processing args now
if not defined _sp_args (
set "_sp_args=!t!"
) else (
@@ -109,8 +109,8 @@ for /f "tokens=1*" %%g in ("%cl_args%") do (
)
)
)
-:: if this is not nil, we have more tokens to process
-:: start above process again with remaining unprocessed cl args
+rem if this is not nil, we have more tokens to process
+rem start above process again with remaining unprocessed cl args
if defined cl_args goto :process_cl_args