microsoft / go-sqlcmd

The new sqlcmd, CLI for SQL Server and Azure SQL (winget install sqlcmd / sqlcmd create mssql / sqlcmd open ads)
https://learn.microsoft.com/sql/tools/sqlcmd/go-sqlcmd-utility
MIT License
323 stars 57 forks source link

sqlcmd -? not found #384

Closed dzsquared closed 11 months ago

dzsquared commented 1 year ago

image

sqlcmd 1.1.0 macos 13.5

stuartpa commented 1 year ago

If the -? Is put in quotes does that fix the issue.

I think ? Might be a special character in the zsh she'll

dzsquared commented 1 year ago

Yep, that does it.

sqlcmd "-?"

provides output

rwestMSFT commented 1 year ago

For documentation purposes, is there a way to resolve this so that it provides output without the quotes? I'm hoping for something useful when a customer runs it on macOS as opposed to an error. zsh is the default shell on macOS now. -? works fine on bash.

shueybubbles commented 1 year ago

sqlcmd --version works for the Go sqlcmd if the goals are to tell if you are running it and to see what version it is.

rwestMSFT commented 1 year ago

@shueybubbles For the documentation, I want to say "Here's one command that works across all versions and platforms", and currently that's sqlcmd '-?'.

stuartpa commented 1 year ago

for go-sqlcmd, sqlcmd --help works across all versions and platforms. Are you looking for a command that works across go-sqlcmd and ODBC sqlcmd?

rwestMSFT commented 1 year ago

Yes.

For the documentation, I want to say "Here's one command that works across all versions and platforms", and currently that's sqlcmd '-?'.

dlevy-msft commented 11 months ago

This is the same behavior as the ODBC version due to the way mac os treats the ?.