Skip to content

fix --help in magics #97

@edublancas

Description

@edublancas

I realized our magics behave funky when passing --help.

Typically, CLIs will print documentation when passing --help, but this is what happens in JupySQL:

%load_ext SQL
%sql --help

Output:

Environment variable $DATABASE_URL not set, and no connect string given.
Connection info needed in SQLAlchemy format, example:
               postgresql://username:password@hostname/dbname
               or an existing connection: dict_keys([])

And with %sqlplot:

%sqlplot --help

Output:

UsageError: the following arguments are required: -t/--table, -c/--column

This is non-standard behavior: CLIs typically display the documentation and finish execution when the only argument is --help; but this isn't happening here. I believe the problem is in IPython, and the argument parser isn't finishing execution when finding --help.

I added some tests in a temporary branch.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggood first issueGood for newcomers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions