Hello There, Guest!
View New Posts  |  View Today's Posts
Command Line Parser Class-Library?

  • 0 Vote(s) - 0 Average


01-14-2013, 08:42 PM #1
0x69
Unregistered
 

Command Line Parser Class-Library?
Would anyone be interested in an open-source CLP class-library?
I've been wanting to make a visually-friendly (go eyecandy!) nix-esque style library for my future projects.

So, if you are interested, ideas?

Current Ideas:
- RGB/Hex Color Fonts

01-14-2013, 09:35 PM #2
KoBE
¯\_(ツ)_/¯
******
Global Moderators
Posts: 4,862 Threads:494 Joined: Jun 2011 Reputation: 67

RE: Command Line Parser Class-Library?
What language are you thinking?

Also, what is a library needed for exactly? To extend functionality to other programs later? Or will this be an application specific library (which is essentially centralizing code)?

01-15-2013, 02:42 PM #3
0x69
Unregistered
 

RE: Command Line Parser Class-Library?
(01-14-2013, 09:35 PM)KoBE Wrote:  What language are you thinking?

Also, what is a library needed for exactly? To extend functionality to other programs later? Or will this be an application specific library (which is essentially centralizing code)?

It will be written in C# but after you compile it as a .DLL, you can use it for any .Net apps.
Also, the general purpose is just to make it easier for people to parse all commands in a command-line program.
E.g: Using 1-line of code to give a user a specific option; compared to multiple.

01-15-2013, 05:58 PM #4
KoBE
¯\_(ツ)_/¯
******
Global Moderators
Posts: 4,862 Threads:494 Joined: Jun 2011 Reputation: 67

RE: Command Line Parser Class-Library?
How would you suggest making it easier? I mean, it's pretty easy to begin w/ since C# provides you with a string array of the arguments.

I don't mean to dump on your idea, I just don't know how it could be much simpler.

01-15-2013, 07:07 PM #5
0x69
Unregistered
 

RE: Command Line Parser Class-Library?
(01-15-2013, 05:58 PM)KoBE Wrote:  How would you suggest making it easier? I mean, it's pretty easy to begin w/ since C# provides you with a string array of the arguments.

I don't mean to dump on your idea, I just don't know how it could be much simpler.

Check this out: Google.Apis.Samples.Helper

Also, its written in C# but because it compiles as just a class-library (DLL), it can be used with any .Net language.

01-15-2013, 09:18 PM #6
KoBE
¯\_(ツ)_/¯
******
Global Moderators
Posts: 4,862 Threads:494 Joined: Jun 2011 Reputation: 67

RE: Command Line Parser Class-Library?
I'm aware of what a DLL does, I was referring to the Command Line Parser class idea specifically.

In order for it to be beneficial it would need to take something and make it simpler. And since C# already hands you the command line arguments in a string array, I was asking how you planned on making it even easier than that.

01-15-2013, 09:26 PM #7
AceInfinity
Developer
*******
Administrators
Posts: 9,733 Threads:1,026 Joined: Jun 2011 Reputation: 76

RE: Command Line Parser Class-Library?
It would be pretty tough to make it simpler as KoBE is hinting... Thinking of it, I think trying to even map it out so that a command line would be parsed to do a specific task or set booleans to do certain things automatically would be somewhat complex, and probably wouldn't fit the needs of everybody using the class as I don't see how you could simplify it further without making it "limited" in some way or another.

It would be hard to do that, and keep it universal for a multitude of usages all at the same time.

Each person that creates a command line app will have different thoughts on how it should be parsed. For instance, whether the flags for the arguments can be mixed and matched in whichever way or whether certain arguments can only be set when other arguments exist in the command line, or whether you can have a different number of arguments, or whether they need to be in a specific order.

Too many variables, and if this was created, I could see it getting pretty "bulky" to do such a simple task that could be set up by the developer on their own to do specifically what they would like to do for the parsing portion.

It is a good try though, if you wanted to just do so for your own learning and share little tricks you came across along the way to help others as well, but for usefulness, I can see how this would be pretty tough to keep minimal, and functional at the same time.
This post was last modified: 01-15-2013, 09:30 PM by AceInfinity.


Microsoft MVP .NET Programming - (2012 - Present)
®Crestron DMC-T Certified Automation Programmer

Development Site: aceinfinity.net

 ▲
 ▲ ▲

01-16-2013, 04:04 PM #8
0x69
Unregistered
 

RE: Command Line Parser Class-Library?
(01-15-2013, 09:26 PM)AceInfinity Wrote:  It would be pretty tough to make it simpler as KoBE is hinting... Thinking of it, I think trying to even map it out so that a command line would be parsed to do a specific task or set booleans to do certain things automatically would be somewhat complex, and probably wouldn't fit the needs of everybody using the class as I don't see how you could simplify it further without making it "limited" in some way or another.

It would be hard to do that, and keep it universal for a multitude of usages all at the same time.

Each person that creates a command line app will have different thoughts on how it should be parsed. For instance, whether the flags for the arguments can be mixed and matched in whichever way or whether certain arguments can only be set when other arguments exist in the command line, or whether you can have a different number of arguments, or whether they need to be in a specific order.

Too many variables, and if this was created, I could see it getting pretty "bulky" to do such a simple task that could be set up by the developer on their own to do specifically what they would like to do for the parsing portion.

It is a good try though, if you wanted to just do so for your own learning and share little tricks you came across along the way to help others as well, but for usefulness, I can see how this would be pretty tough to keep minimal, and functional at the same time.

Open-source FTW?

Nobody said you have to use the source "as-is" and that you can't modify it to your needs.
As I said, go check out Google's .Net Helper.




Forum Jump:



Users browsing this thread: 1 Guest(s)