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

Bug in argument parsing #2159

Closed
1 task done
fredrikw opened this issue Apr 6, 2020 · 2 comments
Closed
1 task done

Bug in argument parsing #2159

fredrikw opened this issue Apr 6, 2020 · 2 comments

Comments

@fredrikw
Copy link
Contributor

fredrikw commented Apr 6, 2020

  • I believe this to be a bug with Open Babel

Environment Information

Open Babel version: 3.0
Operating system and version: Windows 10

Expected Behavior

Not create a file called --gen2D when calling the following command:
obabel -ismi -:CCC -omol -Otf --gen2D
but instead create a file called tf.

Actual Behavior

When parsing the argument -O, to allow for both -Ofilename and -O filename, there is a check after parsing the first version to see if the filename is shorter than 3 characters long. If so, the next argument is used as filename. I think it can be fixed by changing the conditional on line 157 of obbabel.cpp (

if(OutputFileName.size()<3)
) to be similar to the ones for -i and -o.

@baoilleach
Copy link
Member

Good catch.

@fredrikw
Copy link
Contributor Author

fredrikw commented Apr 7, 2020

Might be better to await PR #2152 to simplify merge handling, or include this change there.

fredrikw pushed a commit to fredrikw/openbabel that referenced this issue May 8, 2020
ghutchis added a commit that referenced this issue May 8, 2020
Fix #2159 - Argument parsing och short output file names
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