{"id":47172472,"url":"https://github.com/bryanaustin/version","last_synced_at":"2026-03-13T06:04:30.892Z","repository":{"id":240334906,"uuid":"802351863","full_name":"bryanaustin/version","owner":"bryanaustin","description":"Version string utility program","archived":false,"fork":false,"pushed_at":"2024-06-05T17:57:17.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-06-19T04:25:04.887Z","etag":null,"topics":["bash","utility","version"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bryanaustin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-18T04:13:51.000Z","updated_at":"2024-06-05T17:57:20.000Z","dependencies_parsed_at":"2024-05-18T05:22:44.765Z","dependency_job_id":"ac44c76c-a070-4381-bc75-0f18c8d74e9b","html_url":"https://github.com/bryanaustin/version","commit_stats":null,"previous_names":["bryanaustin/version"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/bryanaustin/version","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bryanaustin%2Fversion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bryanaustin%2Fversion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bryanaustin%2Fversion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bryanaustin%2Fversion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bryanaustin","download_url":"https://codeload.github.com/bryanaustin/version/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bryanaustin%2Fversion/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30459793,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-13T03:55:51.346Z","status":"ssl_error","status_checked_at":"2026-03-13T03:55:33.055Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","utility","version"],"created_at":"2026-03-13T06:04:22.865Z","updated_at":"2026-03-13T06:04:30.883Z","avatar_url":"https://github.com/bryanaustin.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# version\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/bryanaustin/version/.svg)](https://pkg.go.dev/github.com/bryanaustin/version/)\n\nVersion string utility program.\nWorks with any version format. `1.2.3.4`, `v11.22`, `2024.05.08`, `1.2.3-4`\nFor more information about how parsing works, see [Parsing Section](#parsing)\n\n## Install\n\nRequires Go compiler: https://go.dev/dl/\n```bash\ngo install github.com/bryanaustin/version/cmd/version@v1.1.0\n```\nThis will install at `~/go/bin/version` by default.\n\n## Library\n\nThis can also be used as a library if you have the need for such things.\n\n## Usage\n\n_Note: Examples put the options at the end for readability; they don't have to be in that order_\n\n```bash\nversion [options] version\n```\n\n### --base\n```bash\n$ version 1.2.3-1 --base 1.2.3\n1.2.3-2\n```\nThis is the utility's main function, assuming you pass the last version as the argument and the release version for the `--base` option. If the base version matches the last version, it will increment the next highest version number. If it does not, it will adopt the `--base` version and reset all remaining numbers to zero. Separators ignored.\n\n### --increment\n```bash\n$ version 1.2.3 --increment 0.5\n1.7.0\n```\nIncrement the version argument by the amount specified in the option. All smaller numbers will be reset to zero. Separators ignored.\nAdditional allowed values:\n* `major`, same as `1`\n* `minor`, same as `0.1`\n* `patch`, same as `0.0.1`\n* `package`, same as `0.0.0.1`\n\n### --set\n```bash\n$ version 1.2.3 --set 0.5\n1.5.0\n```\nSet the version argument to the non-zero values supplied. All smaller numbers will be reset to zero. Separators ignored.\n\n### --minimum\n```bash\n$ version 1.2.3 --minimum 0.5\n1.5.3\n```\nEnforce a minimum value for the numbers provided. Separators ignored.\n\n### --format\n```bash\n$ version 1.2.3 --format v0-0_1\nv1-2_3\n```\nReturn the provided version argument in the format of the option. Numbers ignored.\n\n### --pad\n```bash\n$ version 5.6.7 --pad 1.2.3\n5.06.007\n```\nEnsure the numbers are zero-padded by the amount specified. Separators ignored.\n\n### --greaterthan\n```bash\n$ version 1.10 --greaterthan 1.9\ntrue\n```\nTests to see if the version argument is greater than the option value. It cannot be used with any other arguments. Separators ignored.\n\n### --lesserthan\n```bash\n$ version 1.9 --lesserthan 1.10\ntrue\n```\nTests to see if the version argument is greater than the option value. It cannot be used with any other arguments. Separators ignored.\n\n## Operation\n\n### Parsing\n\nVersion strings are parsed into arrays of sequential numbers and non-numbers and re-assembled for output. In code, the non-numbers are called separators. Options will often ignore the separators and operate on the provided numbers, so any separators can be used. The exception is the `--format` option, which only uses the separators and ignores the numbers.\n\n### Order of operations\n\nAll options except for `--greaterthan` \u0026 `--lesserthan` can chained together for the combined result. The order of operations is as follows:\n* `--base`\n* `--increment`\n* `--set`\n* `--minimum`\n\nOptions cannot be defined multiple times, and the order they are provided in doesn't matter.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbryanaustin%2Fversion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbryanaustin%2Fversion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbryanaustin%2Fversion/lists"}