()
| 66 | |
| 67 | |
| 68 | def main(): |
| 69 | if len(sys.argv) < 2: |
| 70 | print("Expect new version as argument.") |
| 71 | sys.exit(1) |
| 72 | if len(sys.argv) > 3: |
| 73 | print("Too many arguments.") |
| 74 | sys.exit(1) |
| 75 | |
| 76 | version = sys.argv[1].split(".") |
| 77 | if len(version) > 3: |
| 78 | print("Expect version argument in the format: <MAJOR>.<MINOR>.<PATCH>") |
| 79 | sys.exit(1) |
| 80 | |
| 81 | try: |
| 82 | version = list(int(x) for x in version) |
| 83 | except ValueError: |
| 84 | print("Version values must be valid integers.") |
| 85 | sys.exit(1) |
| 86 | |
| 87 | while version and version[-1] == 0: |
| 88 | version.pop() |
| 89 | |
| 90 | if not version: |
| 91 | print("At least one of the version values must be positive.") |
| 92 | sys.exit() |
| 93 | |
| 94 | make_edits(version) |
| 95 | |
| 96 | |
| 97 | if __name__ == '__main__': |
no test coverage detected