fixed CLI
This commit is contained in:
+3
-3
@@ -31,12 +31,12 @@ In this project directory, you can simply call:
|
|||||||
```
|
```
|
||||||
python -m meme_otron [meme id] "text1" "text2" ... > output.jpg
|
python -m meme_otron [meme id] "text1" "text2" ... > output.jpg
|
||||||
```
|
```
|
||||||
Without pipe redirection with `-c [output]`:
|
Without pipe redirection with `-o [output]`:
|
||||||
```
|
```
|
||||||
python -m meme_otron -c output.png [meme id] "text1" "text2" ...
|
python -m meme_otron -o output.png [meme id] "text1" "text2" ...
|
||||||
```
|
```
|
||||||
|
|
||||||
> Note: with `-c`, you are free to choose the output format
|
> Note: with `-o`, you are free to choose the output format
|
||||||
|
|
||||||
## List of templates
|
## List of templates
|
||||||
|
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ if __name__ == "__main__":
|
|||||||
imgf.load_fonts()
|
imgf.load_fonts()
|
||||||
|
|
||||||
if len(sys.argv) <= 1 or sys.argv[1].lower().strip() == "help" or "-h" in sys.argv:
|
if len(sys.argv) <= 1 or sys.argv[1].lower().strip() == "help" or "-h" in sys.argv:
|
||||||
print("python -h\r\n",
|
print("python -m meme_otron -h\n"
|
||||||
"python -m meme_otron (meme_id) \"[text 1]\" \"[text 2]\" ... > file.jpg\r\n",
|
"python -m meme_otron (meme_id) \"[text 1]\" \"[text 2]\" ... > file.jpg\n"
|
||||||
"python -m meme_otron -o file.jpg (meme_id) \"[text 1]\" \"[text 2]\" ...",
|
"python -m meme_otron -o file.jpg (meme_id) \"[text 1]\" \"[text 2]\" ...",
|
||||||
file=sys.stderr)
|
file=sys.stderr)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
@@ -28,7 +28,7 @@ if __name__ == "__main__":
|
|||||||
if img is None:
|
if img is None:
|
||||||
hint = db.find_nearest(sys.argv[1])
|
hint = db.find_nearest(sys.argv[1])
|
||||||
if hint is not None:
|
if hint is not None:
|
||||||
print(f"Did you mean '{hint}'?")
|
print(f"Did you mean '{hint}'?", file=sys.stderr)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
if output_f is None:
|
if output_f is None:
|
||||||
with os.fdopen(os.dup(sys.stdout.fileno())) as output:
|
with os.fdopen(os.dup(sys.stdout.fileno())) as output:
|
||||||
|
|||||||
Reference in New Issue
Block a user