echo off
setLINT_EXE=C:\lint\lint-nt.exe
setLINT_DIR=-i"C:\lint\lnt"setPRJ_CFG="C:\data\Projects\General\lint\LintConfig.lnt"setCOMMAND=%LINT_EXE%%LINT_DIR%%PRJ_CFG%setPRJ_PATH=C:\data\Projects\General\src
CALL :Seperator
echo Starting PC-Lint
CALL :Seperator
CALL :Seperator
%COMMAND%%PRJ_PATH%\base\main.c
CALL :Seperator
echo Press Any Key to Exit...
pause > nul
:Seperator
echo.
echo###############################################################################echo off
EXIT /B 0
I save it as "linting.bat"
And it works fine without any problem.
I open command prompt and type this command linting.bat and then all the messages are displayed on command prompt.
But now i want to save all the messages in a file, the one method is using this command linting.bat > filename.txt
But the PC-Lint has an option for this, i just have to change my COMMAND macro to
So is there any method to interchange macro definition using command line option.
Means If
liniting.bat in command prompt then messages will get displayed to command prompt window
But if i type
linting.bat log then a log file also gets created.
@echo off
setLINT_EXE=C:\lint\lint-nt.exe
setLINT_DIR=-i"C:\lint\lnt"setLINT_LOG="-os(logging.txt)"setPRJ_CFG="C:\data\Projects\General\lint\LintConfig.lnt"setPRJ_PATH=C:\data\Projects\General\src
If "%1"=="-l" goto LOG_COMMAND
goto COMMAND
:LOG_COMMAND
echo.
echo LOGGING ENABLED (LOG WILL BE CREATED IN FILE LOGGING.TXT)setCOMMAND=%LINT_EXE%%LINT_LOG%%LINT_DIR%%PRJ_CFG%
goto MAIN
:COMMAND
setCOMMAND=%LINT_EXE%%LINT_DIR%%PRJ_CFG%
goto MAIN
:MAIN
CALL :Seperator
echo Starting PC-Lint
CALL :Seperator
Then using command linting.bat -l to log and rest to display the content on Command Window.