Ookii.CommandLine comes with several samples that demonstrate various aspects of its functionality.
- The parser sample demonstrates the basic functionality of defining, parsing and using arguments.
- The long/short mode sample demonstrates the POSIX-like long/short parsing mode,
where arguments can have both a long name with
--
and a short name with-
. - The custom usage sample demonstrates the flexibility of Ookii.CommandLine's usage help generation, by customizing it to use completely different formatting.
- The argument dependencies sample demonstrates how you can have arguments that require or prohibit the presence of other arguments.
- The WPF sample shows how you can use Ookii.CommandLine with a GUI application.
There are three samples demonstrating how to use subcommands:
- The subcommand sample demonstrates how to create a simple application that has multiple subcommands.
- The nested commands sample demonstrates how to create an application where commands can contain other commands. It also demonstrates how to create common arguments for multiple commands using a common base class.
- The top-level arguments sample demonstrates how to use arguments that don't belong to any subcommand before the command name.