[all-commits] [llvm/llvm-project] f671eb: Add command line argument parsing to the Windows p...

Carlos Alberto Enciso via All-commits all-commits at lists.llvm.org
Fri Sep 9 06:37:47 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f671eb17be5cce4db3b4a6ba683921c2727e26cf
      https://github.com/llvm/llvm-project/commit/f671eb17be5cce4db3b4a6ba683921c2727e26cf
  Author: Carlos Alberto Enciso <carlos.alberto.enciso at gmail.com>
  Date:   2022-09-09 (Fri, 09 Sep 2022)

  Changed paths:
    M llvm/utils/release/build_llvm_release.bat

  Log Message:
  -----------
  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' (
    ...
  )




More information about the All-commits mailing list