xpress_embedo
Advanced Member level 4

Hello!! Everyone, here is my batch file program, which lints my Embedded Project for errors:
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.
Please suggest
Code Bash - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 echo off set LINT_EXE=C:\lint\lint-nt.exe set LINT_DIR=-i"C:\lint\lnt" set PRJ_CFG="C:\data\Projects\General\lint\LintConfig.lnt" set COMMAND=%LINT_EXE% %LINT_DIR% %PRJ_CFG% set PRJ_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
Code Bash - [expand] 1 2 set LOG="-os(log.txt)" set COMMAND=%LINT_EXE% %LOG% %LINT_DIR% %PRJ_CFG%
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.
Please suggest