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

Offer python -m sqlite_utils as an alternative to sqlite-utils #368

Closed
simonw opened this issue Jan 9, 2022 · 3 comments
Closed

Offer python -m sqlite_utils as an alternative to sqlite-utils #368

simonw opened this issue Jan 9, 2022 · 3 comments
Labels
Milestone

Comments

@simonw
Copy link
Owner

simonw commented Jan 9, 2022

Add this to sqlite_utils/cli.py:

if __name__ == "__main__":
    cli()

Now the tool can be run using python -m sqlite_utils.cli --help

Originally posted by @simonw in #364 (comment)

@simonw simonw added the cli-tool label Jan 9, 2022
@simonw
Copy link
Owner Author

simonw commented Jan 9, 2022

Even better, inspired by rich, support python -m sqlite_utils. https://github.com/Textualize/rich/blob/master/rich/__main__.py

@simonw simonw changed the title Offer python -m sqlite_utils.cli as an alternative to sqlite-utils Offer python -m sqlite_utils as an alternative to sqlite-utils Jan 9, 2022
simonw added a commit that referenced this issue Jan 9, 2022
@simonw simonw closed this as completed in 539f5cc Jan 9, 2022
@simonw
Copy link
Owner Author

simonw commented Jan 9, 2022

Test failure on Python 3.6:

E TypeError: __init__() got an unexpected keyword argument 'capture_output'

@simonw simonw reopened this Jan 9, 2022
@simonw
Copy link
Owner Author

simonw commented Jan 9, 2022

In Python 3.6: https://docs.python.org/3.6/library/subprocess.html

This does not capture stdout or stderr by default. To do so, pass PIPE for the stdout and/or stderr arguments.

simonw added a commit that referenced this issue Jan 9, 2022
@simonw simonw closed this as completed Jan 9, 2022
@simonw simonw added this to the 3.21 milestone Jan 10, 2022
simonw added a commit that referenced this issue Jan 11, 2022
simonw added a commit that referenced this issue Jan 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant