Replace deprecated OptionParser with ArgumentParser

Change-Id: I8dbee8967edd9cfe1e2f9e2df97d786a2bd1ca94
diff --git a/tools/version.py b/tools/version.py
index 4aafcb0..7ea5482 100755
--- a/tools/version.py
+++ b/tools/version.py
@@ -14,21 +14,16 @@
 # limitations under the License.
 
 from __future__ import print_function
-from optparse import OptionParser
+import argparse
 import os.path
 import re
 import sys
 
-parser = OptionParser()
-opts, args = parser.parse_args()
+parser = argparse.ArgumentParser()
+parser.add_argument('version')
+args = parser.parse_args()
 
-if not len(args):
-    parser.error('not enough arguments')
-elif len(args) > 1:
-    parser.error('too many arguments')
-
-DEST_PATTERN = r'\g<1>%s\g<3>' % args[0]
-
+DEST_PATTERN = r'\g<1>%s\g<3>' % args.version
 
 def replace_in_file(filename, src_pattern):
     try: