#
def main():
- parser = argparse.ArgumentParser()
- parser.add_argument('command')
- parser.add_argument('-p', '--project', help='project name')
- parser.add_argument('-d', '--directory', help='directory within project repo', default='.')
- parser.add_argument('--minor', help='minor version number bump', action='store_true')
- parser.add_argument('--micro', help='micro version number bump', action='store_true')
- parser.add_argument('--major', help='major version to return with latest', type=int)
- parser.add_argument('-c', '--checkout', help='string to pass to git for checkout')
- parser.add_argument('-o', '--output', help='output directory', default='.')
- parser.add_argument('-q', '--quiet', help='be quiet', action='store_true')
- parser.add_argument('-t', '--target', help='target')
- parser.add_argument('-k', '--keep', help='keep working tree', action='store_true')
- parser.add_argument('--debug', help='build with debugging symbols where possible', action='store_true')
- parser.add_argument('-w', '--work', help='override default work directory')
- args = parser.parse_args()
args.output = os.path.abspath(args.output)
if args.work is not None:
else:
raise Error('invalid command %s' % args.command)
+
+#
+# Command-line parser
+#
+
+parser = argparse.ArgumentParser()
+parser.add_argument('command')
+parser.add_argument('-p', '--project', help='project name')
+parser.add_argument('-d', '--directory', help='directory within project repo', default='.')
+parser.add_argument('--minor', help='minor version number bump', action='store_true')
+parser.add_argument('--micro', help='micro version number bump', action='store_true')
+parser.add_argument('--major', help='major version to return with latest', type=int)
+parser.add_argument('-c', '--checkout', help='string to pass to git for checkout')
+parser.add_argument('-o', '--output', help='output directory', default='.')
+parser.add_argument('-q', '--quiet', help='be quiet', action='store_true')
+parser.add_argument('-t', '--target', help='target')
+parser.add_argument('-k', '--keep', help='keep working tree', action='store_true')
+parser.add_argument('--debug', help='build with debugging symbols where possible', action='store_true')
+parser.add_argument('-w', '--work', help='override default work directory')
+args = parser.parse_args()
+
try:
main()
except Error as e: