Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding command-line support by pulling @smilepleeeaz's improvements into your repository #7

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,18 @@ Since there wasn't any WinMTR build with IPv6, I decided to do it myself ;) The
**If you're looking for an alternative** *(not meant for long-term traces)* there's [**vTrace**](http://vtrace.pl).
It's some really interesting piece of Software ;) *(with more then just trace routes)*
~~~~

##About new fork by @smilepleeeaz
I have created this fork to support the WinMTR in console mode.
I have changed the Linker Subsystem to console and added support for commandline argument --report or -r.
When run with commandline argument --report or -r, the WInMTR will be pure console and would show no GUI.
When run without --report or -r , the normal GUI of WinMTR will be shown with a blink of console window.
All my changes are contained in the compile time directive WIN_MTR_NO_GUI, and the original WinMTR can be restored by compiling it after undefining this macro.
The reports are printed on standard output and errors, if any are printed on standard error.
I have added support for below two command line arguments -
1. --duration (-d)
It specifies the duration in seconds for which duration the tracing is to be done. On duration expiry, the tracing is stopped and report is printed.
2. --report (-r)
It specifies whether the error logs should be printed on standard error or not. It works with duration param.
All these changes are under the same GPLv2 license as the original.

2 changes: 1 addition & 1 deletion src/WinMTR.rc
Original file line number Diff line number Diff line change
Expand Up @@ -291,4 +291,4 @@ END
// Manifest resources
//
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
1 RT_MANIFEST ".\\manifest.xml"
//1 RT_MANIFEST ".\\manifest.xml"
18 changes: 9 additions & 9 deletions src/WinMTR.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinMTR", "WinMTR.vcxproj", "{EE7B51B5-96FC-BED3-F2A6-0713CECBB579}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinMTR", "WinMTR.vcxproj", "{23314146-5882-4574-A7C3-8508595BEF90}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -11,14 +11,14 @@ Global
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{EE7B51B5-96FC-BED3-F2A6-0713CECBB579}.Debug|Win32.ActiveCfg = Debug|Win32
{EE7B51B5-96FC-BED3-F2A6-0713CECBB579}.Debug|Win32.Build.0 = Debug|Win32
{EE7B51B5-96FC-BED3-F2A6-0713CECBB579}.Debug|x64.ActiveCfg = Debug|x64
{EE7B51B5-96FC-BED3-F2A6-0713CECBB579}.Debug|x64.Build.0 = Debug|x64
{EE7B51B5-96FC-BED3-F2A6-0713CECBB579}.Release|Win32.ActiveCfg = Release|Win32
{EE7B51B5-96FC-BED3-F2A6-0713CECBB579}.Release|Win32.Build.0 = Release|Win32
{EE7B51B5-96FC-BED3-F2A6-0713CECBB579}.Release|x64.ActiveCfg = Release|x64
{EE7B51B5-96FC-BED3-F2A6-0713CECBB579}.Release|x64.Build.0 = Release|x64
{23314146-5882-4574-A7C3-8508595BEF90}.Debug|Win32.ActiveCfg = Debug|Win32
{23314146-5882-4574-A7C3-8508595BEF90}.Debug|Win32.Build.0 = Debug|Win32
{23314146-5882-4574-A7C3-8508595BEF90}.Debug|x64.ActiveCfg = Debug|x64
{23314146-5882-4574-A7C3-8508595BEF90}.Debug|x64.Build.0 = Debug|x64
{23314146-5882-4574-A7C3-8508595BEF90}.Release|Win32.ActiveCfg = Release|Win32
{23314146-5882-4574-A7C3-8508595BEF90}.Release|Win32.Build.0 = Release|Win32
{23314146-5882-4574-A7C3-8508595BEF90}.Release|x64.ActiveCfg = Release|x64
{23314146-5882-4574-A7C3-8508595BEF90}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Binary file modified src/WinMTR.suo
Binary file not shown.
9 changes: 6 additions & 3 deletions src/WinMTR.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<UseOfMfc>Static</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
Expand Down Expand Up @@ -115,12 +115,14 @@
</Bscmake>
<Link>
<SuppressStartupBanner>true</SuppressStartupBanner>
<SubSystem>Windows</SubSystem>
<SubSystem>NotSet</SubSystem>
<OutputFile>.\Release_x32\WinMTR.exe</OutputFile>
<AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<UACExecutionLevel>AsInvoker</UACExecutionLevel>
<EnableUAC>false</EnableUAC>
<UACUIAccess>true</UACUIAccess>
<EntryPointSymbol>
</EntryPointSymbol>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
Expand Down Expand Up @@ -203,6 +205,7 @@
<UACExecutionLevel>AsInvoker</UACExecutionLevel>
<EnableUAC>false</EnableUAC>
<UACUIAccess>true</UACUIAccess>
<EntryPointSymbol>WinMainCRTStartup </EntryPointSymbol>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
Expand Down Expand Up @@ -250,6 +253,7 @@
<ResourceCompile Include="WinMTR.rc" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="console.cpp" />
<ClCompile Include="WinMTRLicense.cpp" />
<ClCompile Include="WinMTRStatusBar.cpp" />
<ClCompile Include="WinMTRDialog.cpp" />
Expand All @@ -264,7 +268,6 @@
<ClInclude Include="WinMTRLicense.h" />
<ClInclude Include="WinMTRStatusBar.h" />
<ClInclude Include="Resource.h" />
<ClInclude Include="stdafx.h" />
<ClInclude Include="WinMTRDialog.h" />
<ClInclude Include="WinMTRGlobal.h" />
<ClInclude Include="WinMTRHelp.h" />
Expand Down
88 changes: 88 additions & 0 deletions src/WinMTR.vcxproj.filters
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="WinMTRDialog.cpp">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="WinMTRStatusBar.cpp">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="WinMTRGlobal.cpp">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="WinMTRHelp.cpp">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="WinMTRLicense.cpp">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="WinMTRMain.cpp">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="WinMTRNet.cpp">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="WinMTROptions.cpp">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="WinMTRProperties.cpp">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="console.cpp">
<Filter>src</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="Resource.h">
<Filter>h</Filter>
</ClInclude>
<ClInclude Include="WinMTRDialog.h">
<Filter>h</Filter>
</ClInclude>
<ClInclude Include="WinMTRGlobal.h">
<Filter>h</Filter>
</ClInclude>
<ClInclude Include="WinMTRHelp.h">
<Filter>h</Filter>
</ClInclude>
<ClInclude Include="WinMTRLicense.h">
<Filter>h</Filter>
</ClInclude>
<ClInclude Include="WinMTRMain.h">
<Filter>h</Filter>
</ClInclude>
<ClInclude Include="WinMTRNet.h">
<Filter>h</Filter>
</ClInclude>
<ClInclude Include="WinMTROptions.h">
<Filter>h</Filter>
</ClInclude>
<ClInclude Include="WinMTRProperties.h">
<Filter>h</Filter>
</ClInclude>
<ClInclude Include="WinMTRStatusBar.h">
<Filter>h</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Filter Include="h">
<UniqueIdentifier>{4ada380a-a16f-460a-8359-3a7f1270a407}</UniqueIdentifier>
</Filter>
<Filter Include="src">
<UniqueIdentifier>{a7d2c54d-c731-4a37-8b0d-01cc2112ac9e}</UniqueIdentifier>
</Filter>
<Filter Include="res">
<UniqueIdentifier>{168054a8-f62f-493a-9592-a7f8251cc0d0}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="WinMTR.rc">
<Filter>res</Filter>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="WinMTR.ico">
<Filter>res</Filter>
</CustomBuild>
</ItemGroup>
</Project>
7 changes: 7 additions & 0 deletions src/WinMTR.vcxproj.user
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LocalDebuggerCommandArguments>-r -d 5 www.google.com &gt; a.txt</LocalDebuggerCommandArguments>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
</Project>
Loading