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

Accept dashes as switch markers #5

Closed
jacebennett opened this issue Jul 1, 2011 · 4 comments
Closed

Accept dashes as switch markers #5

jacebennett opened this issue Jul 1, 2011 · 4 comments

Comments

@jacebennett
Copy link
Member

I can't kick off my command line utility from bash because '/D' is expanded to a directory by the shell. I'd like to be able to use either slash or dash to mark a switch so that I can use the utility from a broader set of environments.

@cbrianball
Copy link
Member

IModelBindingDefinition defines a property called SwitchDelimiter that allows you to change it to something other than the default forward slash /. You can also call the extension method AsFluent() off of IModelBindingDefinition, then call UsingSwitchDelimiter() to change the delimiter used by Args.

Let me know if this doesn't work for you.

@jacebennett
Copy link
Member Author

Awesome. I'll look at it. I'm really wanting to have both options, perhaps even mix-n-match. Would this allow for that? If not, I'll make a pull request as I'm reworking Thorn (soon).

@cbrianball
Copy link
Member

You mean to allow for a command like:

myapp.exe -d "my value" /t 0

Args doesn't currently support that, it runs under the assumption that all delimiters are the same.

@jacebennett
Copy link
Member Author

The mix 'n match is really silly. Nevermind. What I'll do is surface a configuration for it in thorn and pass it to you when I create the binding definition. Thanks. For having fixed my issue before I had it. =o)

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

No branches or pull requests

2 participants