Home - mzh99/MHCmdLine GitHub Wiki

MHCmdLine is a C# Class Library for processing and parsing command-line arguments.

Notes:

  • Assumes a space-delimited (Windows) style command line.
  • Flags are not positional and can be used anywhere in the command-line.
  • Assumes a convention of dashes or similar for switches followed immediately by the associated parameter
    Example: /fc:\temp\OutputFolder
  • To pass spaces in an argument (long file names, for example), the entire argument must be enclosed in quotes.
  • Flags are case-sensitive. (-f vs -F)
  • Command-line parameters without switches are assumed to be positional and can be obtained with a call to GetPositionalParms().
  • Command-line parameters starting with a leading character that don't match one of the allowed flags can be obtained with a call to GetExtraneousParms().

See MHCmdLine.Tests for examples.

Currently targets .Net Standard 2.0 and .Net Framework 4.6.1. To use the NuGet package, refer to: OCSS.Util.CmdLine