Getting started, getting stuck
See original GitHub issueTrying out this library with a toy example:
using CommandLine;
using System;
namespace Test_CommandArgs
{
class Options
{
[Option('a', "optiona", Required = true, HelpText = "Option A")]
string a {get; set;}
}
class Program
{
static void Main(string[] args)
{
var results = CommandLine.Parser.Default.ParseArguments<Options>(new string[] {});
Console.WriteLine(results.Tag);
Console.WriteLine(results.);
}
}
}
For the last line, I was hoping that VS would show me an attribute that I’d expect to hold a reference to the options object, but I can’t see it:
What am I doing wrong? How do I get that reference?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:7 (6 by maintainers)
Top Results From Across the Web
Helpful Tips When You're Stuck on Getting Started
Helpful Ideas When You're Stuck on Getting Started · 1. Think outside the rut. · 2. Ask yourself questions. · 3. Why power...
Read more >Feeling Stuck? 7 Ways to Climb Out of a Slump
So the feeling of being stuck can be frustrating. Rather than beat yourself up over feeling stuck, treat yourself with self-compassion.
Read more >How to Get Started When You're Stuck
Think about the project overall. Describe the goal to yourself in a few sentences. Write down all the major things that need to...
Read more >Joe McCall - Getting Started, Getting Stuck and ... - YouTube
I recently interviewed Joe McCall to ask him about life before REI, the roadblocks most new investors face, what powers his most successful ......
Read more >A Guide to Getting Unstuck - Forcing Function
Getting stuck is often caused by points of indecision. A lack of conviction is paralyzing and leads to an over-reliance on willpower. Motivation...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hmmm. Pity it doesn’t expose the parsed value directly, say in a ParserResult.Value property. This means an awkward (to me) workaround like:
Also, both approaches are at odds with the example code which looks very nice https://archive.codeplex.com/?p=commandline
If the quickstart example could be improved for a user that isnt familiar with the library, a pull request would be welcome and thanks in order.