Advertisement
AlvinSeville7cf

code generation result.bat

Mar 10th, 2021 (edited)
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 1.65 KB | None | 0 0
  1. @echo off
  2. rem Template-generated program. Please modify it.
  3. setlocal
  4.  
  5. call :init
  6.  
  7. set /a "i=0"
  8. :copy_options
  9.     set "option=%~1"
  10.     if defined option (
  11.         set "args[%i%]=%option%"
  12.         shift
  13.         set /a "i+=1"
  14.         goto copy_options
  15.     )
  16. set /a "args_count=i"
  17.  
  18. set /a "i=0"
  19. :main_loop
  20.     set /a "j=i + 1"
  21.     call set "option=%%args[%i%]%%"
  22.     call set "value=%%args[%j%]%%"
  23.  
  24.    set /a "is__h=FALSE"
  25.    if "%option%" == "-h" set /a "is__h=TRUE"
  26.    if "%option%" == "-hlp" set /a "is__h=TRUE"
  27.    if "%option%" == "--help" set /a "is__h=TRUE"
  28.  
  29.    if %is__h% equ %TRUE% (
  30.        call :_h_handler
  31.        exit /b %SUCCESS_EC%
  32.    )
  33.  
  34.    set /a "is__v=FALSE"
  35.    if "%option%" == "-v" set /a "is__v=TRUE"
  36.    if "%option%" == "-vrsn" set /a "is__v=TRUE"
  37.    if "%option%" == "--version" set /a "is__v=TRUE"
  38.  
  39.    if %is__v% equ %TRUE% (
  40.        call :_v_handler
  41.        exit /b %SUCCESS_EC%
  42.    )
  43.  
  44.    set /a "is__f=FALSE"
  45.    if "%option%" == "-f" set /a "is__f=TRUE"
  46.    if "%option%" == "-fl" set /a "is__f=TRUE"
  47.    if "%option%" == "--file" set /a "is__f=TRUE"
  48.  
  49.    if %is__f% equ %TRUE% (
  50.        call :_f_handler
  51.        exit /b %SUCCESS_EC%
  52.    )
  53.  
  54. exit /b %SUCCESS_EC%
  55.  
  56. :init
  57.    set /a "SUCCESS_EC=0"
  58.    set /a "UNSPECIFIED_FAIL_EC=1"
  59.    set /a "TRUE=0"
  60.    set /a "FALSE=1"
  61. exit /b %SUCCESS_EC%
  62.  
  63. :_h_handler
  64.    echo _h_handler executed. Please change this template-generated code.
  65. exit /b %SUCCESS_EC%
  66.  
  67. :_v_handler
  68.    echo _v_handler executed. Please change this template-generated code.
  69. exit /b %SUCCESS_EC%
  70.  
  71. :_f_handler
  72.    echo _f_handler executed. Please change this template-generated code.
  73. exit /b %SUCCESS_EC%
  74.  
  75.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement