Compare commits
3 Commits
main
...
mdk-missin
Author | SHA1 | Date |
---|---|---|
Julien Palard | 6830ff0271 | |
Julien Palard | 446aafa72e | |
Julien Palard | f3c0441cd7 |
|
@ -301,7 +301,7 @@ def parse_args():
|
|||
version="%(prog)s " + __version__ + " using hunspell: " + HUNSPELL_VERSION,
|
||||
)
|
||||
parser.add_argument("--debug", action="store_true")
|
||||
parser.add_argument("-p", "--personal-dict", type=str)
|
||||
parser.add_argument("-p", "--personal-dict", type=Path)
|
||||
parser.add_argument(
|
||||
"--modified", "-m", action="store_true", help="Use git to find modified files."
|
||||
)
|
||||
|
@ -313,6 +313,9 @@ def parse_args():
|
|||
help="Number of files to check in paralel, defaults to all available CPUs",
|
||||
)
|
||||
args = parser.parse_args()
|
||||
if args.personal_dict is not None and not args.personal_dict.exists():
|
||||
print(f"Error: dictionary {str(args.personal_dict)!r} not found.")
|
||||
sys.exit(1)
|
||||
if args.drop_capitalized and args.no_drop_capitalized:
|
||||
print("Error: don't provide both --drop-capitalized AND --no-drop-capitalized.")
|
||||
parser.print_help()
|
||||
|
@ -350,7 +353,7 @@ def run_hunspell(language, personal_dict, input_lines):
|
|||
input=quote_for_hunspell(text for _, _, text in input_lines),
|
||||
)
|
||||
except subprocess.CalledProcessError:
|
||||
return -1
|
||||
return []
|
||||
return parse_hunspell_output(input_lines, output.splitlines())
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue