Add command line argument parsing to the Windows packaging script.
authorCarlos Alberto Enciso <carlos.alberto.enciso@gmail.com>
Fri, 9 Sep 2022 13:36:40 +0000 (14:36 +0100)
committerCarlos Alberto Enciso <carlos.alberto.enciso@gmail.com>
Fri, 9 Sep 2022 13:36:40 +0000 (14:36 +0100)
commitf671eb17be5cce4db3b4a6ba683921c2727e26cf
treeb9f9ae9d5d43b465c55c7f521c539f78b09c5c32
parent5b1df2e9514adc476019ff1cc423923e8a91d8f6
Add command line argument parsing to the Windows packaging script.

As discussed here:
https://discourse.llvm.org/t/build-llvm-release-bat-script-options

Add a function to parse command line arguments: `parse_args`.

The format for the arguments is:
  Boolean: --option
  Value:   --option<separator>value
    with `<separator>` being: space, colon, semicolon or equal sign

Command line usage example:
  my-batch-file.bat --build --type=release --version 123

It will create 3 variables:
  `build` with the value `true`
  `type` with the value `release`
  `version` with the value `123`

Usage:
  set "build="
  set "type="
  set "version="

  REM Parse arguments.
  call :parse_args %*

  if defined build (
    ...
  )
  if %type%=='release' (
    ...
  )
  if %version%=='123' (
    ...
  )
llvm/utils/release/build_llvm_release.bat