summaryrefslogtreecommitdiffstats
path: root/vendor/os_info/examples
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/os_info/examples')
-rw-r--r--vendor/os_info/examples/print_version.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/vendor/os_info/examples/print_version.rs b/vendor/os_info/examples/print_version.rs
new file mode 100644
index 000000000..0047fbcc2
--- /dev/null
+++ b/vendor/os_info/examples/print_version.rs
@@ -0,0 +1,13 @@
+fn main() {
+ let info = os_info::get();
+
+ // Print full information:
+ println!("OS information: {}", info);
+
+ // Print information separately:
+ println!("Type: {}", info.os_type());
+ println!("Version: {}", info.version());
+ println!("Edition: {:?}", info.edition());
+ println!("Codename: {:?}", info.codename());
+ println!("Bitness: {}", info.bitness());
+}