Creating a complex console application

The typical console application is one that can perform a single type of functionality, whose behavior is controlled through command-line options (switches) and arguments. Because it is the most commonly-created type of console application, ConsoleFx provides the ConsoleFx.Programs.Simple.ConsoleProgram class to create such applications fast and easily.

However, in some case, you may want to create more complex console applications that can perform several different kinds of functionalities based on the options and arguments specified.
In such cases, you'd use the ConsoleFx.Programs.Complex.ConsoleProgram class. This class exposes a lot more ConsoleFx internals than does the simple ConsoleProgram class.

The CLI application that we will be creating is a file utility application called FILEOP that can perform backups, file copies and file deletion. In other words, it can perform, 3 different types of functionalities.
The source code for this guide is available under the samples\GettingStarted\Complex directory.

The signatures and usage of FILEOP are shown below:

FILEOP -backup [-verbose] [-type:Full|Incremental] [-exclude:mask1,mask2,...] <directory> <zip file path>
FILEOP -copy [-overwrite] <source file> <destination file>
FILEOP -delete <target file>

Table of Contents

  1. Understanding program contexts

Last edited Nov 7, 2011 at 11:57 AM by jeevanjj, version 2


No comments yet.