Skip to content

CLI parse hangs reading stdin when no argument provided and stdin is a TTY #294

@ajitpratap0

Description

@ajitpratap0

Description

Running gosqlx parse with no arguments and no piped input causes it to hang indefinitely reading stdin.

Reproduction

gosqlx parse
# hangs forever, no prompt, no usage hint

Expected

When stdin is a TTY (interactive terminal) and no argument is given, the command should print usage/help and exit instead of silently waiting for input.

Workaround

Always provide an argument: gosqlx parse "SELECT 1" or pipe: echo "SELECT 1" | gosqlx parse -

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcli

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions