GithubHelp home page GithubHelp logo

8bitzeta / os_info Goto Github PK

View Code? Open in Web Editor NEW

This project forked from stanislav-tkach/os_info

0.0 0.0 0.0 786 KB

Rust library to detect the operating system type

License: MIT License

Rust 100.00%

os_info's Introduction

os_info

Status: CI Coverage Dependency status

Project info: Docs.rs Latest version License

Project details: LoC Rust 1.60+ required

Overview

This project consists of two parts: the library that can be used to detect the operating system type (including version and bitness) and the command line tool that uses the library.

Library (os_info)

os_info usage

To use this crate, add os_info as a dependency to your project's Cargo.toml:

[dependencies]
os_info = "3"

This project has serde as an optional dependency, so if you don't need it, then you can speed up compilation disabling it:

[dependencies]
os_info = { version = "3", default-features = false }

Example

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!("Bitness: {}", info.bitness());
println!("Architecture: {}", info.architecture());

Command line tool (os_info_cli)

A simple wrapper around the os_info library.

Installation

This tool can be installed using the following cargo command:

cargo install os_info_cli

os_info_cli usage

Despite being named os_info_cli during installation, it is actually named os_info. You can use the --help flag to see available options:

os_info --help

Supported operating systems

Right now, the following operating system types can be returned:

  • Alpaquita Linux
  • Alpine Linux
  • Amazon Linux AMI
  • Android
  • Arch Linux
  • Artix Linux
  • CentOS
  • Debian
  • DragonFly BSD
  • Emscripten
  • EndeavourOS
  • Fedora
  • FreeBSD
  • Garuda Linux
  • Gentoo Linux
  • HardenedBSD
  • Illumos
  • Linux
  • macOS (Mac OS X or OS X)
  • Manjaro
  • Mariner
  • MidnightBSD
  • Mint
  • NetBSD
  • NixOS
  • OpenBSD
  • openSUSE
  • Oracle Linux
  • Pop!_OS
  • Raspberry Pi OS
  • Red Hat Linux
  • Red Hat Enterprise Linux
  • Redox
  • Solus
  • SUSE Linux Enterprise Server
  • Ubuntu
  • Unknown
  • Windows

If you need support for more OS types, I am looking forward to your Pull Request.

License

os_info is licensed under the MIT license. See LICENSE for the details.

os_info's People

Contributors

stanislav-tkach avatar martintc avatar zacbrown avatar 8bitzeta avatar kraileth avatar dependabot[bot] avatar exincore avatar lonami avatar zhiburt avatar odarrouzet avatar ydirson avatar dependabot-preview[bot] avatar coding-badly avatar leavelet avatar dejankos avatar mattmccarty avatar rbas avatar cube707 avatar codybloemhard avatar yestercafe avatar badboy avatar cuviper avatar kianmeng avatar killavus avatar meop avatar otavio avatar ecnelises avatar siilwyn avatar snambakam avatar kholmanskikh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.