Search
Documentation | Project Roadmap | SourceForge links | *** For users of the old beta ***

Project Description

ConsoleFx is an .NET framework for easily developing command-line interface (CLI) applications. It automates most of the work involved in creating a CLI application, like command line argument parsing, error handling and validations. ConsoleFx supports both fluent and declarative (using attributes) programming models.
With ConsoleFx, you can say goodbye to lengthy cumbersome code to parse your command-line arguments.

Using the ConsoleFx command-line parser, you can specify a whole host of conditions for specifying command-line arguments. These can include the ability to:
  • Enforce the order of the command-line arguments
  • Specify switch options and limit the number of times they can occur as command-line arguments
  • Allow parameters to be specified for switch options, and limit the number of parameters that can be specified
  • Specify non-switch arguments and how they are to be used
  • Run custom validations on switch parameters and non-switch arguments, including tests for regular expressions, file masks, integers, booleans, enums, etc.
  • Automatically map non-switch arguments to strong-typed properties for easier readability

In addition, ConsoleFx also provides the following extras:
  • A separate command-line parsing engine that can be used in non-CLI applications like Windows Forms and WPF applications.
  • Ability to create an interactive command-line shell application that utilizes ConsoleFx's build-in parser to handle input.
  • Utility classes for console output capturing and extensions to the Console class. We plan to add other utility classes in the future, making it the all-in-one solution for creating your command-line applications.

We have a large documentation section with Getting Started guides, advanced topics and references for ConsoleFx. In particular, check out our Getting Started guide to writing a simple console application to get a quick start on using ConsoleFx.

Currently, we're finishing up on the first version of ConsoleFx, and planning for the next version has already started. See our project roadmap for details.

Overview

ConsoleFx provides a fluent API for specifying the rules for processing command-line arguments.

For example, the following code creates a command-line application that supports these signatures:
BACKUP [/type:Full|Incremental] [/verbose] <directory to backup>
BACKUP /?

var backupApp = new ConsoleProgram(includeHelpSupport: true);
backupApp.AddOption("type", "t", expectedParameters: 1)
    .ValidateWith(new EnumValidator(typeof(BackupTypes))))
    .AssignTo(() => BackupType);
backupApp.AddOption("verbose", "v")
    .Flag(() => VerboseOutput);
backupApp.AddArgument()
    .ValidateWith(new PathValidator { PathType = PathType.Directory, CheckIfExists = true })
    .AssignTo(() => DirectoryToBackup);
backupApp.Run();

SourceForge Information

ConsoleFx source code is hosted on the SourceForge SVN repository. We frequently update the CodePlex SVN repository to be in sync with the SourceForge repository.

ConsoleFx home on SF.net | Subversion URL
Last edited Nov 23 2011 at 9:23 PM by jeevanjj, version 40
Updating...
© 2006-2012 Microsoft | Get Help | Privacy Statement | Terms of Use | Code of Conduct | Advertise With Us | Version 2012.1.11.18365