Created
May 6, 2023 23:32
-
-
Save asciidiego/9b9809897e3cb1dac123178eedc57be7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/opt/homebrew/bin/python3 | |
import sys | |
import urllib.parse | |
import subprocess | |
if len(sys.argv) < 2: | |
print("Usage: python explainshell.py [shell command as string here]") | |
sys.exit(1) | |
command = ' '.join(sys.argv[1:]) | |
url = f"https://explainshell.com/explain?cmd={urllib.parse.quote(command)}" | |
subprocess.run(['open', url]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment