diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-05-20 20:00:18 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-05-21 16:33:04 +0200 |
commit | 3ca606d103cb9c4011cfcb1d377b6749fb73aaec (patch) | |
tree | 267b4d54a33ffd91749e1f2802a96e88abb69770 /man/os-release.xml | |
parent | man: add an example how to correctly read os-release in shell (diff) | |
download | systemd-3ca606d103cb9c4011cfcb1d377b6749fb73aaec.tar.xz systemd-3ca606d103cb9c4011cfcb1d377b6749fb73aaec.zip |
man: add example os-release mangling in python
This is also not entirely obvious. I think the code I came
up with is pretty elegant ;] The final part of of the code that makes
use of the parsed data is kept very similar to the shell code on purpose,
even though it could be written a bit more idiomatically.
Diffstat (limited to 'man/os-release.xml')
-rw-r--r-- | man/os-release.xml | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/man/os-release.xml b/man/os-release.xml index 36e5bed62e..a00b8a5264 100644 --- a/man/os-release.xml +++ b/man/os-release.xml @@ -419,6 +419,14 @@ VARIANT_ID=workstation</programlisting> <programlisting><xi:include href="check-os-release.sh" parse="text" /></programlisting> </example> + + <example> + <title>Reading <filename>os-release</filename> in + <citerefentry><refentrytitle>python</refentrytitle><manvolnum>1</manvolnum></citerefentry></title> + + <programlisting><xi:include href="check-os-release.py" parse="text" /></programlisting> + </example> + </refsect1> <refsect1> |