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

Fix: space delimited args for -i and -v #440

Merged
merged 4 commits into from
Aug 1, 2023
Merged

Conversation

shueybubbles
Copy link
Collaborator

Fixes #348
Short of completely rewriting the command line parser and ignoring Cobra, we are subject to a fair number of limitations for backward compatibility.

Of note:

  • The os.Args array doesn't give any clue whether the argument was passed in quotes.
  • Cobra doesn't parse the raw command line, it relies on the args array and its limitations.

This fix increases the number of command line variants that will be ODBC compatible but is far from exhaustive.
Users who don't use commas and dashes in their file names will be fine using space-delimited arguments for -i.

Copy link
Contributor

@apoorvdeshmukh apoorvdeshmukh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the limitation of os.Args not indicating the quotes, windows specific?
The testcase with filename containing "-i" was quite insightful.
Thanks for updating the readme regarding comma limitations.

@shueybubbles shueybubbles merged commit c61c1a7 into main Aug 1, 2023
6 checks passed
@shueybubbles shueybubbles deleted the shueybubbles/348 branch August 1, 2023 16:25
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.

preserve compatibility with odbc sqlcmd for -v
2 participants