github.com/hanks177/podman/v4@v4.1.3-0.20220613032544-16d90015bc83/contrib/msi/podman.bat (about)

     1  @echo off
     2  setlocal enableextensions
     3  
     4  title Podman
     5  
     6  if "%1" EQU "" (
     7    goto run_help
     8  )
     9  
    10  if "%1" EQU "/?" (
    11    goto run_help
    12  )
    13  
    14  :: If remote-host is given on command line -- use it
    15  setlocal enabledelayedexpansion
    16  for %%a in (%*) do (
    17    echo "%%a" |find "--remote-host" >NUL
    18    if !errorlevel! == 0 (
    19      goto run_podman
    20    )
    21  )
    22  
    23  :: If PODMAN_VARLINK_BRIDGE is set -- use it
    24  if defined PODMAN_VARLINK_BRIDGE (
    25    goto run_podman
    26  )
    27  
    28  :: If the configuration file exists -- use it
    29  set config_home=%USERPROFILE%\AppData\podman
    30  set config_file=%config_home%\podman-remote.conf
    31  if exist "%config_file%" (
    32    goto run_podman
    33  )
    34  
    35  :: Get connection information from user and build configuration file
    36  md "%config_home%"
    37  set /p host="Please enter the remote hosts name or IP address: "
    38  set /p user="Please enter the remote user name: "
    39  (
    40    echo [connections]
    41    echo   [connections."%host%"]
    42    echo   destination = "%host%"
    43    echo   username = "%user%"
    44    echo   default = true
    45  ) >"%config_file%"
    46  
    47  :run_podman
    48  endlocal
    49  podman-remote-windows.exe %*
    50  goto end
    51  
    52  :run_help
    53  set run=start "Podman Help" /D "%~dp0" /B
    54  
    55  if not "%3" == "" (
    56    %run% "podman-%2-%3.html
    57    goto end
    58  )
    59  
    60  if not "%2" == "" (
    61    %run% "podman-%2.html
    62    goto end
    63  )
    64  
    65  %run% "%podman-remote.html"
    66  goto end
    67  
    68  :End