mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-20 00:02:55 +00:00
chore: give all args to arg parser instead of omitting arg0
This commit is contained in:
parent
2b1c048a4a
commit
32480a75eb
@ -73,7 +73,7 @@ void ImageConverterArgs::SetVerbose(const bool isVerbose)
|
|||||||
bool ImageConverterArgs::ParseArgs(const int argc, const char** argv, bool& shouldContinue)
|
bool ImageConverterArgs::ParseArgs(const int argc, const char** argv, bool& shouldContinue)
|
||||||
{
|
{
|
||||||
shouldContinue = true;
|
shouldContinue = true;
|
||||||
if (!m_argument_parser.ParseArguments(argc - 1, &argv[1]))
|
if (!m_argument_parser.ParseArguments(argc, argv))
|
||||||
{
|
{
|
||||||
PrintUsage();
|
PrintUsage();
|
||||||
return false;
|
return false;
|
||||||
|
@ -245,7 +245,7 @@ std::set<std::string> LinkerArgs::GetSearchPathsForProject(const std::set<std::s
|
|||||||
bool LinkerArgs::ParseArgs(const int argc, const char** argv, bool& shouldContinue)
|
bool LinkerArgs::ParseArgs(const int argc, const char** argv, bool& shouldContinue)
|
||||||
{
|
{
|
||||||
shouldContinue = true;
|
shouldContinue = true;
|
||||||
if (!m_argument_parser.ParseArguments(argc - 1, &argv[1]))
|
if (!m_argument_parser.ParseArguments(argc, argv))
|
||||||
{
|
{
|
||||||
PrintUsage();
|
PrintUsage();
|
||||||
return false;
|
return false;
|
||||||
|
@ -89,7 +89,7 @@ void RawTemplaterArguments::PrintVersion()
|
|||||||
bool RawTemplaterArguments::ParseArgs(const int argc, const char** argv, bool& shouldContinue)
|
bool RawTemplaterArguments::ParseArgs(const int argc, const char** argv, bool& shouldContinue)
|
||||||
{
|
{
|
||||||
shouldContinue = true;
|
shouldContinue = true;
|
||||||
if (!m_argument_parser.ParseArguments(argc - 1, &argv[1]))
|
if (!m_argument_parser.ParseArguments(argc, argv))
|
||||||
{
|
{
|
||||||
PrintUsage();
|
PrintUsage();
|
||||||
return false;
|
return false;
|
||||||
|
@ -265,7 +265,7 @@ void UnlinkerArgs::ParseCommaSeparatedAssetTypeString(const std::string& input)
|
|||||||
bool UnlinkerArgs::ParseArgs(const int argc, const char** argv, bool& shouldContinue)
|
bool UnlinkerArgs::ParseArgs(const int argc, const char** argv, bool& shouldContinue)
|
||||||
{
|
{
|
||||||
shouldContinue = true;
|
shouldContinue = true;
|
||||||
if (!m_argument_parser.ParseArguments(argc - 1, &argv[1]))
|
if (!m_argument_parser.ParseArguments(argc, argv))
|
||||||
{
|
{
|
||||||
PrintUsage();
|
PrintUsage();
|
||||||
return false;
|
return false;
|
||||||
|
@ -33,8 +33,13 @@ bool ArgumentParser::ParseArguments(std::vector<std::string>& args)
|
|||||||
m_matched_arguments.clear();
|
m_matched_arguments.clear();
|
||||||
m_matched_options.clear();
|
m_matched_options.clear();
|
||||||
|
|
||||||
|
if (args.empty())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
m_path = args[0];
|
||||||
|
|
||||||
const auto argCount = args.size();
|
const auto argCount = args.size();
|
||||||
for (unsigned argIndex = 0; argIndex < argCount; argIndex++)
|
for (unsigned argIndex = 1u; argIndex < argCount; argIndex++)
|
||||||
{
|
{
|
||||||
auto& arg = args[argIndex];
|
auto& arg = args[argIndex];
|
||||||
|
|
||||||
|
@ -23,4 +23,5 @@ private:
|
|||||||
std::vector<const CommandLineOption*> m_command_line_options;
|
std::vector<const CommandLineOption*> m_command_line_options;
|
||||||
std::map<const CommandLineOption*, std::vector<std::string>> m_matched_options;
|
std::map<const CommandLineOption*, std::vector<std::string>> m_matched_options;
|
||||||
std::vector<std::string> m_matched_arguments;
|
std::vector<std::string> m_matched_arguments;
|
||||||
|
std::string m_path;
|
||||||
};
|
};
|
||||||
|
@ -138,7 +138,7 @@ void ZoneCodeGeneratorArguments::PrintVersion()
|
|||||||
bool ZoneCodeGeneratorArguments::ParseArgs(const int argc, const char** argv, bool& shouldContinue)
|
bool ZoneCodeGeneratorArguments::ParseArgs(const int argc, const char** argv, bool& shouldContinue)
|
||||||
{
|
{
|
||||||
shouldContinue = true;
|
shouldContinue = true;
|
||||||
if (!m_argument_parser.ParseArguments(argc - 1, &argv[1]))
|
if (!m_argument_parser.ParseArguments(argc, argv))
|
||||||
{
|
{
|
||||||
PrintUsage();
|
PrintUsage();
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user