Skip to main content

Module distro

Module distro 

Source
Expand description

Distro specifier parsing.

Accepts four input forms and normalizes each to a strongly-typed DistroSpec { org, repo }:

  • bare name omne-nosce{ omne-org, omne-nosce } (default org)
  • <org>/<repo>{ org, repo } (trailing .git stripped)
  • HTTPS URL https://github.com/<org>/<repo>(.git)?
  • SSH URL git@github.com:<org>/<repo>(.git)?

The returned struct drops the URL form the Python parser emitted because downstream code (github.rs in Unit 4) keys the GitHub Releases API on (org, repo) — the URL was never actually used.

Fixes two Python bugs (R12):

  • file:// URLs are rejected outright, not silently accepted.
  • Non-github.com HTTPS/SSH hosts are rejected explicitly.

Structs§

DistroSpec
A parsed distro reference keyed on (org, repo).

Enums§

Error
Errors produced by parse(). Wrapped into CliError::Distro at the command boundary once Unit 8a wires distro parsing into init::run.

Functions§

parse
Parse a distro specifier into DistroSpec { org, repo }.