Conversation
|
Nice. :) If this is useful to you, it's useful to other people. |
1769a8f to
2791a30
Compare
|
I implemented a simple heuristic that should work for most cases. Two cases that are not supported are:
These cases are too complex to come up with a heuristic. An actual SQL parser would need to be used to support these. Now I have an issue with showing SQL query after man page quits. The user entered query should be re-desplayed, but I don't know how to do that. I tried |
|
@jonathanslenders can you advise? |
| def try_man(page): | ||
| try: | ||
| subprocess.run( | ||
| f"man -I 7 {page}", shell=True, check=True, universal_newlines=True |
Check warning
Code scanning / CodeQL
Unsafe shell command constructed from library input
Description
Make F1 key launch man page for current query. E.g. I have
CREATE TABLE fooas my query and I pressF1. The man pageCREATE_TABLEis launched. This requires man pages to be installed locally, I'm not sure they're always installed. I have it on my manjaro, but I don't see man pages on ubuntu, only the html docs.This is currently just a scratch implementation, let me know if you're interested in having such functionality.
Also, I'm not a python dev, any suggestions welcomed.
Checklist
changelog.rst.AUTHORSfile (or it's already there).pip install pre-commit && pre-commit install), and ranblackon my code.