mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-20 03:23:23 +08:00
[0.3.x] fixed : issue #13052 ( incorrect command line parsing )
git-svn-id: https://pykd.svn.codeplex.com/svn@88657 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
9dca38d926
commit
ceb07a7708
@ -102,52 +102,25 @@ KDLIB_EXT_COMMAND_METHOD_IMPL(PykdExt, py)
|
|||||||
|
|
||||||
ArgsList::iterator foundArg;
|
ArgsList::iterator foundArg;
|
||||||
|
|
||||||
foundArg = std::find( args.begin(), args.end(), "-h" );
|
if ( !args.empty() )
|
||||||
if ( foundArg != args.end() )
|
{
|
||||||
|
if ( args[0] == "-h" || args[0] == "--help" )
|
||||||
{
|
{
|
||||||
printUsage();
|
printUsage();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
foundArg = std::find( args.begin(), args.end(), "--help" );
|
if ( args[0] == "-g" || args[0] == "--global" )
|
||||||
if ( foundArg != args.end() )
|
|
||||||
{
|
|
||||||
printUsage();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
foundArg = std::find( args.begin(), args.end(), "-g" );
|
|
||||||
if ( foundArg != args.end() )
|
|
||||||
{
|
{
|
||||||
global = true;
|
global = true;
|
||||||
args.erase( foundArg );
|
args.erase( args.begin() );
|
||||||
}
|
}
|
||||||
|
else
|
||||||
foundArg = std::find( args.begin(), args.end(), "--global" );
|
if ( args[0] == "-l" || args[0] == "--local" )
|
||||||
if ( foundArg != args.end() )
|
|
||||||
{
|
|
||||||
global = true;
|
|
||||||
args.erase( foundArg );
|
|
||||||
}
|
|
||||||
|
|
||||||
foundArg = std::find( args.begin(), args.end(), "-l" );
|
|
||||||
if ( foundArg != args.end() )
|
|
||||||
{
|
{
|
||||||
local = true;
|
local = true;
|
||||||
args.erase( foundArg );
|
args.erase( args.begin() );
|
||||||
}
|
}
|
||||||
|
|
||||||
foundArg = std::find( args.begin(), args.end(), "--local" );
|
|
||||||
if ( foundArg != args.end() )
|
|
||||||
{
|
|
||||||
local = true;
|
|
||||||
args.erase( foundArg );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( global && local )
|
|
||||||
{
|
|
||||||
pykd::eprintln( L"-g(--global) and -l(--local) cannot be set together" );
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string scriptFileName;
|
std::string scriptFileName;
|
||||||
|
Loading…
Reference in New Issue
Block a user