Click here to Skip to main content
15,889,840 members
Articles / Programming Languages / C#

A C#/.NET Attributes Based Command Line Argument Parser

Rate me:
Please Sign up or sign in to vote.
4.96/5 (9 votes)
10 Jan 2012CPOL21 min read 43.1K   1.6K   37  
This article introduces an easy to use attribute/reflection based library for seamlessly parsing command line arguments for applications.
//
// NAttrArgs
//
// Copyright (c) 2012 Pete Barber
//
// Licensed under the The Code Project Open License (CPOL.html)
// http://www.codeproject.com/info/cpol10.aspx 
//
using System.IO;
using ls;

namespace TestMS.ls
{
	public class TestableListFileSystem : ListFileSystem
	{
		public TestableListFileSystem(TextWriter output, string root)
			: base(output, root)
		{

		}

		public TestableListFileSystem(TextWriter output = null, string root = null, string dirSuffix = null)
			: base(output, root, dirSuffix)
		{

		}

		public void TestListDirFromArg()
		{
			base.ListDirFromArg();
		}

		public void TestListDir(DirectoryInfo dirPath)
		{
			base.ListDir(dirPath);
		}
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Team Leader
United Kingdom United Kingdom
My day job is mostly working in C++ with a bit of C#. I write a fair amount of command line based tools and really wish they could have a GUI front-end to them hence why I spend my spare time working with WPF.

I started a blog few years back but didn't do a lot with it. I've started describing some of the interesting programming things I come across on it. Please take a look.

Comments and Discussions