Skip to content
jc-rs
GitHub

os-release

--os-releasev1.2.0

Converts `/etc/os-release` file content to JSON

file
$ cat input.txt | jc-rs --os-release

A real pair

From the reference corpus (generic/os-release-ubuntu.json). The left pane is the input the fixture ships; the right pane is the corpus's expected JSON. CI compares jc-rs with it field by field under the published differential. Hover a value to see where it came from.

os_releasegeneric
NAME="Ubuntu"
VERSION="18.04.5 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.5 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
expected outputjson
Use the Left and Right arrow keys to highlight the matching value in the input.
{
  "NAME": "Ubuntu",
  "VERSION": "18.04.5 LTS (Bionic Beaver)",
  "ID": "ubuntu",
  "ID_LIKE": "debian",
  "PRETTY_NAME": "Ubuntu 18.04.5 LTS",
  "VERSION_ID": "18.04",
  "HOME_URL": "https://www.ubuntu.com/",
  "SUPPORT_URL": "https://help.ubuntu.com/",
  "BUG_REPORT_URL": "https://bugs.launchpad.net/ubuntu/",
  "PRIVACY_POLICY_URL": "https://www.ubuntu.com/legal/terms-and-policies/privacy-policy",
  "VERSION_CODENAME": "bionic",
  "UBUNTU_CODENAME": "bionic"
}

Fixture coverage

2/2oracle-valid pairs match under the published structural JSON comparison

Magic syntax

not availableThis parser reads a file or a string rather than a command, so there is nothing for jc-rs to run. Pipe it in.

Source: crates/jc-rs-parsers/src/misc/os_release.rs. jc-rs targets the schemas defined by the original Python tool. Fixture coverage above is the measured evidence for this parser; test the inputs your pipeline depends on. Compare