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

PartiQL CLI options are ignored #1268

Open
RCHowell opened this issue Nov 14, 2023 · 0 comments
Open

PartiQL CLI options are ignored #1268

RCHowell opened this issue Nov 14, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@RCHowell
Copy link
Contributor

Description

The CLI options --in and --input-format are ignored.

override fun run() {
        val command = executionOptions ?: ExecutionOptions()
        val shell = shellOptions ?: ShellOptions()
        when {
            // !! should check if command.inputFile != null !!
            command.query != null -> runCli(command, command.query!!.inputStream())
            System.console() == null -> runCli(command, System.`in`)
            else -> runShell(shell)
        }
    }

https://github.com/partiql/partiql-lang-kotlin/blob/main/partiql-cli/src/main/kotlin/org/partiql/cli/pico/PartiQLCommand.kt#L67

To Reproduce

Steps to reproduce the behavior:

# Checkout erroneous build
git clone git@github.com:partiql/partiql-lang-kotlin.git partiql-help && cd partiql-help
git checkout c6bf4aec

# Install executable
./gradlew :partiql-cli:install

# Create test file
echo "'Hello, world!;'" > test.sql

./partiql-cli/build/install/partiql-cli/bin/partiql -i test.sql    # ERROR — does not work
./partiql-cli/build/install/partiql-cli/bin/partiql test.sql       # OK — prints 'Hello, world!'
cat test.sql | ./partiql-cli/build/install/partiql-cli/bin/partiql  # OK — prints 'Hello, world!'

Expected Behavior

Should check if command.inputFile != null then process that file

Additional Context

  • Java version: XXX
  • PartiQL version: 0.13.2-c6bf4aec and HEAD
  • Add any other context about the problem here.
@RCHowell RCHowell added the bug Something isn't working label Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant