Skip to content

Commit

Permalink
arguments grouped
Browse files Browse the repository at this point in the history
  • Loading branch information
soeren-kirchner committed Nov 8, 2019
1 parent dc629d6 commit a0033ce
Showing 1 changed file with 25 additions and 19 deletions.
44 changes: 25 additions & 19 deletions pyimgbatch/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,31 @@ def main():

def get_args():
parser = argparse.ArgumentParser()
parser.add_argument('-c', '--configfile', type=str,
default='imagebatch.json', help='configuration file')
parser.add_argument('-p', '--project', type=str,
default='pyimagebatch.json', help='configuration file')
parser.add_argument('-s', '--source', type=str,
default='.', help='source folder containing images for batch processing')
parser.add_argument('-d', '--dest', type=str, default='dest',
help='destination folder for the processed images')
parser.add_argument('-o', '--override', action='store_true',
default=False, help='overrides existing files')
parser.add_argument('--no-progress', action='store_true',
default=False, help='disables the progress bars')
parser.add_argument('--debug', action='store_true',
default=False, help='disables the progress bars')

parser.add_argument('--width', type=int,
default=None, help='...')
parser.add_argument('--height', type=int,
default=None, help='...')

file_handling_group = parser.add_argument_group('file handling')
file_handling_group.add_argument('-c', '--configfile', type=str,
default='imagebatch.json', help='configuration file')
file_handling_group.add_argument('-p', '--project', type=str,
default='pyimagebatch.json', help='configuration file')
file_handling_group.add_argument('-s', '--source', type=str,
default='.', help='source folder containing images for batch processing')
file_handling_group.add_argument('-d', '--dest', type=str, default='dest',
help='destination folder for the processed images')
file_handling_group.add_argument('-o', '--override', action='store_true',
default=False, help='overrides existing files')

output_group = parser.add_argument_group('output / user interaction')
output_group.add_argument('--no-progress', action='store_true',
default=False, help='disables the progress bars')
output_group.add_argument('--debug', action='store_true',
default=False, help='enables debugging level.')
# TODO: logging, logfile

image_manipulation_group = parser.add_argument_group('image manipulation')
image_manipulation_group.add_argument('--width', type=int,
default=None, help='...')
image_manipulation_group.add_argument('--height', type=int,
default=None, help='...')

return parser.parse_args()

Expand Down

0 comments on commit a0033ce

Please sign in to comment.