Unrecognized Arguments Help Text vs `--help` Help Text, different output
See original GitHub issueDescribe the issue
I am trying to use the --redo-ocr
argument which notes that it is unrecognized (looks like this was noted in #397). I am on version 8.3.1 so that is kind of odd. So I ran --help
to check if I am using the argument wrong somehow, and I noticed that the argument list is different in --help
and matches what the docs on the website note.
To Reproduce What command line were you trying to run?
running:
ocrmypdf --redo-ocr input.pdf output.pdf
returns:
usage: ocrmypdf [-h] [-l LANGUAGE] [--image-dpi DPI]
[--output-type {pdfa,pdf,pdfa-1,pdfa-2}] [--sidecar [FILE]]
[--version] [-j N] [-q] [-v [VERBOSE]] [--title TITLE]
[--author AUTHOR] [--subject SUBJECT] [--keywords KEYWORDS]
[-r] [--remove-background] [-d] [-c] [-i] [--oversample DPI]
[-f] [-s] [--skip-big MPixels] [--max-image-mpixels MPixels]
[--tesseract-config CFG] [--tesseract-pagesegmode PSM]
[--tesseract-oem MODE]
[--pdf-renderer {auto,tesseract,hocr,sandwich}]
[--tesseract-timeout SECONDS]
[--rotate-pages-threshold CONFIDENCE]
[--pdfa-image-compression {auto,jpeg,lossless}]
[--user-words FILE] [--user-patterns FILE] [--skip-repair]
[-k] [-g] [--flowchart FLOWCHART]
input_pdf_or_image output_pdf
ocrmypdf: error: unrecognized arguments: --redo-ocr
and running:
ocrmypdf --help
returns:
usage: ocrmypdf [-h] [-l LANGUAGE] [--image-dpi DPI]
[--output-type {pdfa,pdf,pdfa-1,pdfa-2,pdfa-3}]
[--sidecar [FILE]] [--version] [-j N] [-q] [-v [VERBOSE]]
[--title TITLE] [--author AUTHOR] [--subject SUBJECT]
[--keywords KEYWORDS] [-r] [--remove-background] [-d] [-c]
[-i] [--unpaper-args UNPAPER_ARGS] [--oversample DPI]
[--remove-vectors] [--mask-barcodes] [--threshold] [-f] [-s]
[--redo-ocr] [--skip-big MPixels] [-O {0,1,2,3}]
[--jpeg-quality Q] [--png-quality Q] [--jbig2-lossy]
[--max-image-mpixels MPixels] [--tesseract-config CFG]
[--tesseract-pagesegmode PSM] [--tesseract-oem MODE]
[--pdf-renderer {auto,hocr,sandwich}]
[--tesseract-timeout SECONDS]
[--rotate-pages-threshold CONFIDENCE]
[--pdfa-image-compression {auto,jpeg,lossless}]
[--user-words FILE] [--user-patterns FILE] [-k]
[--flowchart FLOWCHART]
input_pdf_or_image output_pdf
[rest of output removed for clarity]
Expected behavior
- The
--redo-ocr
to not return unrecognized. - The unrecognized argument help text and
--help
text to match.
System:
- OS: Ubuntu v18.04 (via WSL on Windows)
- OCRmyPDF Version: v8.3.1
Issue Analytics
- State:
- Created 4 years ago
- Comments:9
Top Results From Across the Web
Unrecognized Arguments Help Text vs `--help` Help ... - GitHub
So I ran --help to check if I am using the argument wrong somehow, and I noticed that the argument list is different...
Read more >python - Argparse: unrecognized argument - Stack Overflow
You are using the wrong character: >>> parser = argparse.ArgumentParser(description='This program downloads webcam images') ...
Read more >Argparse Tutorial
Let's show the sort of functionality that we are going to explore in this introductory tutorial by making use of the ls command:....
Read more >Issue 39106: Add suggestions to argparse error message ...
-1 Given an unknown argument, we really can't know what the user intended. The usage string already lists all available options and -h...
Read more >Command line arguments · Python Basics
the help argument is used to specify text to be displayed for those options in help message. $ ./sort_file.py usage: sort_file.py [-h] -f...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think a procedure along those lines would be helpful. I tried out WSL myself and added some procedure; I found it tricky to get consistent behavior. Feel free to expand it.
I think your updated procedure makes a lot of sense to me 👍