Skip to content

Commit

Permalink
Add --help command line argument and welcome message
Browse files Browse the repository at this point in the history
  • Loading branch information
Ludwig-Work committed Jun 1, 2023
1 parent 9a2220e commit d902bf6
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions LazyMathInstructor/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -388,12 +388,35 @@ internal class Program
return terms;
}

/// <summary>
/// Print help message when the program is called with -h or --help command line argument.
/// </summary>
static void PrintHelpMessage()
{
Console.WriteLine("LazyMathInstructor by Ludwig Kolesch\n" +
"Source and explanation: https://github.com/Ludwig-Uni/Lazy-Math-Instructor\n" +
"Usage: Enter the number of equivalences to test and all the terms via STDIN.\n" +
"Terminate each input with a newline.\n" +
"\n" +
"Options:\n" +
" -v, --verbose: Output parsed terms\n" +
" -h, --help: Display this message");
}

/// <summary>
/// Entry point of the program. Reads input from STDIN and prints YES or NO for each pair of terms
/// entered, depending on whether they are equivalent, according to the specification.
/// </summary>
static void Main(string[] args)
{
if (args.Contains("-h") || args.Contains("--help"))
{
PrintHelpMessage();
return;
}

Console.WriteLine("LazyMathInstructor by Ludwig Kolesch\nReading input from STDIN now.\n");

bool verbose = args.Contains("-v") || args.Contains("--verbose");

var terms = GetInputTerms();
Expand Down

0 comments on commit d902bf6

Please sign in to comment.