Created
February 25, 2016 14:29
-
-
Save aracknobus/13b3a87d6100183b6ba0 to your computer and use it in GitHub Desktop.
Simple cmd script to make a debug-like command-line switch and setting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION | |
:: Name: DebugSwitchTemplate.cmd | |
:: Author: Aracknobus | |
:: Version: v0.1 - Feb '16 | |
:: | |
:: | |
SET DEBUGVAR=0 | |
SET DEBUGECHO=0 | |
SET DEBUGCMD=0 | |
IF "%DEBUGVAR%" EQU "1" SET DEBUG=1 | |
IF "%1"=="/debug" SET DEBUG=1 | |
IF "%DEBUG%" EQU "1" ( | |
SET DEBUGECHO=ECHO | |
SET DEBUGCMD=ECHO %~n0: | |
) ELSE ( | |
SET DEBUGECHO=REM | |
SET DEBUGCMD= | |
) | |
shift | |
:: Main | |
cls | |
%DEBUGECHO% Hello World! | |
%DEBUGCMD% echo %~n0: Simple echo line visible only in debug mode | |
pause |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment