Skip to content

Adding support for base types besides floats, ints, and strings #20

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

Merged
merged 1 commit into from
Sep 15, 2015
Merged

Conversation

JohnHBrock
Copy link

Somewhat related to #17.

Verified

This commit was signed with the committer’s verified signature. The key has expired.
weihanglo Weihang Lo
carlobaldassi added a commit that referenced this pull request Sep 15, 2015

Verified

This commit was signed with the committer’s verified signature. The key has expired.
weihanglo Weihang Lo
Adding support for base types besides floats, ints, and strings
@carlobaldassi carlobaldassi merged commit 1975f4d into carlobaldassi:master Sep 15, 2015
@carlobaldassi
Copy link
Owner

Thanks!

@c42f
Copy link

c42f commented Sep 22, 2015

This is a cool feature, though per the security concerns in #17, should we really be embedding the julia parser itself even more deeply in the command line argument parsing process? I fear that once people start using this feature in full generality, it will be impossible to go back to to something simple and secure. (Unless there's a way to run the parser in a security restricted mode, only allowing parsing of a given type, and no macro expansion, etc?)

@c42f
Copy link

c42f commented Sep 22, 2015

It would be a shame to get into a situation where accepting command line user input to a script forced me to run a separate external script to sanitize the inputs.

@JohnHBrock
Copy link
Author

I agree. This PR was meant to restore broken functionality, but this may not be a desirable feature long-term. A better approach, for example, might be to include an optional function property for each argument that can map a string or vector of strings to whatever the desired type is.

@c42f
Copy link

c42f commented Sep 22, 2015

Ah right. Has this broken functionality been present since 0.2 though? If so, I think the ability to parse only simple floats and ints etc would count as a feature by now ;-) At least we could make use of it to avoid giving too much power which later becomes a liability.

I wonder if it would make sense to have a restricted julia parser mode which only accepted literals or some such. I'm not sure if this makes sense, but I recall it's been done before in the python world: a restricted subset of syntax for literals which is cheaper and simpler to parse, and without the security gotchas of allowing arbitrary code.

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

Successfully merging this pull request may close these issues.

None yet

3 participants