Skip to content

Commit

Permalink
fix: fix help, version command and overall error output
Browse files Browse the repository at this point in the history
  • Loading branch information
massimo-rnd authored Feb 5, 2025
2 parents 1e2da5f + 459d876 commit 93e0267
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions FFMP.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,15 @@ static void Main(string[] args)
})
.WithNotParsed(errors =>
{
Console.WriteLine("Failed to parse arguments.");
foreach (var error in errors)
// Check if the user requested help/version information
if (errors.Any(error => error is CommandLine.HelpRequestedError || error is CommandLine.VersionRequestedError))
{
Console.WriteLine(error.ToString());
Environment.Exit(0); // Exit without error message
}

// Otherwise, print an actual error message
Console.WriteLine("Error: Invalid arguments provided.");

Environment.Exit(1);
});
}
Expand Down

0 comments on commit 93e0267

Please sign in to comment.