aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/bin/shift.py
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2016-08-30 01:57:00 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2016-08-30 01:57:00 +0300
commit61f13a8708cfb0adadf31b3d1ffe5f70b1103e0f (patch)
tree5386c793836e85801fd2c9116b83b191247c63b5 /bin/shift.py
parentfactor common code out (diff)
downloadfilters-61f13a8708cfb0adadf31b3d1ffe5f70b1103e0f.tar.gz
filters-61f13a8708cfb0adadf31b3d1ffe5f70b1103e0f.zip
more useful help messages + README update
Diffstat (limited to '')
-rw-r--r--bin/shift.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/bin/shift.py b/bin/shift.py
index 8dfd76a..94db333 100644
--- a/bin/shift.py
+++ b/bin/shift.py
@@ -32,17 +32,18 @@ def _parse_direction(s):
raise argparse.ArgumentTypeError('invalid direction: ' + s)
def _parse_args(args=sys.argv):
- parser = argparse.ArgumentParser()
- parser.add_argument('img_path')
- parser.add_argument('--output', '-o',
- dest='output_path', default=None)
- parser.add_argument('--direction', '-d',
- type=_parse_direction,
- choices=Direction,
- default=DEFAULT_DIRECTION)
+ parser = argparse.ArgumentParser(
+ description='Shift an image by a few pixels in a specified direction.')
+ parser.add_argument('img_path', help='source image file path')
+ parser.add_argument('--output', '-o', dest='output_path', default=None,
+ help='save new image to a file')
+ parser.add_argument('--direction', '-d', choices=Direction,
+ type=_parse_direction, default=DEFAULT_DIRECTION,
+ help='specify shifting direction')
parser.add_argument('--distance', '-n',
type=cmd_line.parse_non_negative_integer,
- default=DEFAULT_DISTANCE)
+ default=DEFAULT_DISTANCE,
+ help='specify shift size (in pixels)')
return parser.parse_args(args[1:])
def _main(args=sys.argv):