Start iterating on arguments at 1 since argv[0] is the executable's path

This commit is contained in:
Username404 2021-09-28 21:51:51 +02:00
parent 8f60e7052f
commit 80118d29a7
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 1 additions and 1 deletions

View File

@ -16,7 +16,7 @@ int main(int argc, char* argv[]) {
bool newLines = true; bool newLines = true;
set<string_view> files; set<string_view> files;
for (signed int i = 0; i < argc; ++i) for (signed int i = 1; i < argc; ++i)
{ {
const string_view currentArg (argv[i]); const string_view currentArg (argv[i]);
if ((argc == 2) && (currentArg == Argument("version"))) { cout << Yerbacon::getVersion() << endl; exit(EXIT_SUCCESS); } if ((argc == 2) && (currentArg == Argument("version"))) { cout << Yerbacon::getVersion() << endl; exit(EXIT_SUCCESS); }