question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unrecognized Arguments Help Text vs `--help` Help Text, different output

See original GitHub issue

Describe 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

  1. The --redo-ocr to not return unrecognized.
  2. 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:closed
  • Created 4 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
jbarlow83commented, Jul 22, 2019

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.

0reactions
jboldacommented, Aug 13, 2019

I think your updated procedure makes a lot of sense to me 👍

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found