Skip to content

Instantly share code, notes, and snippets.

@oblaser
Last active March 15, 2022 20:21
Show Gist options
  • Save oblaser/b01abd204b4645256f8b949e1a052dcd to your computer and use it in GitHub Desktop.
Save oblaser/b01abd204b4645256f8b949e1a052dcd to your computer and use it in GitHub Desktop.
@rem
@rem author Oliver Blaser
@rem date 15.03.2022
@rem copyright GNU GPLv3 - Copyright (c) 2022 Oliver Blaser
@rem
@echo off
if not "%~2"=="" goto argWarn
if "%~1"=="" goto printHelp
if "%~1"=="/?" goto printHelp
if "%~1"=="-h" goto printHelp
if "%~1"=="--help" goto printHelp
if "%~1"=="--version" goto printVersion
:touch
pushd %~dp1
copy /b %1+,,
popd
goto exit
:argWarn
echo only the first argument is processed
goto printHelp
:printHelp
echo.Usage:
echo. touch ^{option ^| FILE^}
echo.
echo.Options:
echo. --help, -h prints this help text
echo. --version prints version info
echo.
echo.
echo.Website: ^<https://gist.github.com/oblaser/b01abd204b4645256f8b949e1a052dcd^>
goto exit
:printVersion
echo.touch 1.0.0
echo.
echo.Copyright (c) 2022 Oliver Blaser
echo.License: GNU GPLv3 ^<http://gnu.org/licenses/^>.
echo.This is free software. There is NO WARRANTY.
goto exit
:exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment