def main():
args = get_arguments()<EOL>setup_logging(args)<EOL>version_path = os.path.abspath(os.path.join(<EOL>os.path.dirname(__file__),<EOL>'<STR_LIT:..>',<EOL>'<STR_LIT:..>',<EOL>'<STR_LIT>'<EOL>))<EOL>try:<EOL><INDENT>version_text = open(version_path).read().strip()<EOL><DEDENT>except Exception:<EOL><INDENT>print('<STR_LIT>')<EOL>sys.exit(<NUM_LIT:1>)<EOL><DEDENT>try:<EOL><INDENT>semver.parse(version_text)<EOL><DEDENT>except ValueError:<EOL><INDENT>print(('<STR_LIT>'<EOL>'<STR_LIT>').format(version_text))<EOL>sys.exit(<NUM_LIT:1>)<EOL><DEDENT>new_version = version_text<EOL>if args.version:<EOL><INDENT>try:<EOL><INDENT>if semver.parse(args.version):<EOL><INDENT>new_version = args.version<EOL><DEDENT><DEDENT>except Exception:<EOL><INDENT>print('<STR_LIT>'.format(args.version))<EOL>sys.exit(<NUM_LIT:1>)<EOL><DEDENT><DEDENT>elif args.bump_major:<EOL><INDENT>new_version = semver.bump_major(version_text)<EOL><DEDENT>elif args.bump_minor:<EOL><INDENT>new_version = semver.bump_minor(version_text)<EOL><DEDENT>elif args.bump_patch:<EOL><INDENT>new_version = semver.bump_patch(version_text)<EOL><DEDENT>try:<EOL><INDENT>with open(version_path, '<STR_LIT:w>') as version_file:<EOL><INDENT>version_file.write(new_version)<EOL><DEDENT><DEDENT>except Exception:<EOL><INDENT>print('<STR_LIT>')<EOL>sys.exit(<NUM_LIT:1>)<EOL><DEDENT>print(new_version)<EOL>
Main method.

This method holds what you want to execute when
the script is run on command line.