diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2016-07-19 05:22:29 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2016-07-19 05:22:29 +0300 |
commit | 029d418483abbcbcd3c92d0473e330a749dbc218 (patch) | |
tree | ac1f79f0bf64a051b47fc889d0eb530fa8fac86e /bin | |
parent | README update (diff) | |
download | vk-scripts-029d418483abbcbcd3c92d0473e330a749dbc218.tar.gz vk-scripts-029d418483abbcbcd3c92d0473e330a749dbc218.zip |
mutual_friends.py: interface update
Diffstat (limited to '')
-rw-r--r-- | bin/mutual_friends.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/bin/mutual_friends.py b/bin/mutual_friends.py index 56b19f6..9a1dfc4 100644 --- a/bin/mutual_friends.py +++ b/bin/mutual_friends.py @@ -73,7 +73,7 @@ def _parse_output_format(s): try: return OutputFormat(s) except ValueError: - raise argparse.ArgumentTypeError('invalid output format: ' + str(s)) + raise argparse.ArgumentTypeError('invalid output format: ' + s) def _parse_args(args=sys.argv): parser = argparse.ArgumentParser( @@ -81,11 +81,12 @@ def _parse_args(args=sys.argv): parser.add_argument('uids', metavar='UID', nargs='+', help='user IDs or "screen names"') - parser.add_argument('--output-format', dest='fmt', - type=_parse_output_format, default=OutputFormat.CSV, + parser.add_argument('-f', '--format', dest='fmt', + type=_parse_output_format, + default=OutputFormat.CSV, choices=OutputFormat, help='specify output format') - parser.add_argument('-o', '--output', dest='fd', metavar='PATH', + parser.add_argument('-o', '--output', metavar='PATH', dest='fd', type=argparse.FileType('w', encoding='utf-8'), default=sys.stdout, help='set output file path (standard output by default)') |