Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how can i parse params like "dosomething.exe aaa --disable-background" #77

Open
ysunf opened this issue Dec 14, 2016 · 2 comments
Open
Labels

Comments

@ysunf
Copy link

ysunf commented Dec 14, 2016

i can see the usage for params with short name or long name, but how about the params without names? For example, the chrome, startup with "chrome.exe www.bing.com --disable-background-networking" or maybe "chrome.exe --disable-background-networking www.bing.com --disable-component-update"? Thanks for your help!

@aguarino77
Copy link

Why don't you just parse from index 1 like:

var result = p.Parse(args.Skip(1).ToArray());

@siywilliams
Copy link
Member

Better support for this in 1.5, see #89

fclp.Setup(arg => arg.Url)
      .As("url")
      .UseForOrphanArguments(); // any leading values with no option are captured for this option

fclp.Setup(arg => arg.DisableBackgroundNetworking)
      .As("disable-background-networking);

fclp.Parse(args);

// fclp.Object.Url will now contain "www.bing.com"

Which supports your chrome.exe www.bing.com --disable-background-networking example.

super!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants