[ocrfeeder] Replace the -i CLI option by a positional argument
- From: Joaquim Manuel Pereira Rocha <jrocha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ocrfeeder] Replace the -i CLI option by a positional argument
- Date: Sun, 18 Mar 2018 14:08:31 +0000 (UTC)
commit f5f1b076993ec0ba94250f21051e049072c7e230
Author: Joaquim Rocha <me joaquimrocha com>
Date: Sun Mar 18 15:04:06 2018 +0100
Replace the -i CLI option by a positional argument
This will avoid the current errors when OCRFeeder is called without an
argument for the --image option.
With a positional argument, the same functionality is possible but made
simpler (thanks to Alberto Garcia for the suggestion).
gb#767732
resources/ocrfeeder.desktop.in | 2 +-
src/ocrfeeder/studio/studioBuilder.py | 7 +++----
2 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/resources/ocrfeeder.desktop.in b/resources/ocrfeeder.desktop.in
index 47fb238..ede5108 100644
--- a/resources/ocrfeeder.desktop.in
+++ b/resources/ocrfeeder.desktop.in
@@ -4,7 +4,7 @@ Type=Application
_Name=OCRFeeder
_Comment=The complete OCR suite.
TryExec=ocrfeeder
-Exec=ocrfeeder -i %f
+Exec=ocrfeeder %F
Icon=ocrfeeder
MimeType=image/bmp;image/gif;image/jpeg;image/jpg;image/pjpeg;image/png;image/tiff;
Categories=Application;Office;
diff --git a/src/ocrfeeder/studio/studioBuilder.py b/src/ocrfeeder/studio/studioBuilder.py
index 062ab01..43cb432 100644
--- a/src/ocrfeeder/studio/studioBuilder.py
+++ b/src/ocrfeeder/studio/studioBuilder.py
@@ -123,10 +123,9 @@ class Studio:
self.main_window.setDestroyEvent(self.quit)
parser = ArgumentParser(description=OCRFEEDER_STUDIO_COMMENTS)
- parser.add_argument('-i', '--images', metavar='IMAGE1 [IMAGE2, ...]',
- nargs='+', help='images to be automatically added '
- 'on start-up. Use the option before every image '
- 'path.')
+ parser.add_argument('images', metavar='IMAGE',
+ nargs='*', help='images to be automatically added '
+ 'on start-up')
parser.add_argument('-d', '--dir', help='directory with images to be '
'added automatically on start-up')
parser.add_argument('-v', '--version', action='version',
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]