Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gomezmig03/pak-command
Get system's package manager and the availability of certain commands. Test rust library for a course.
https://github.com/gomezmig03/pak-command
Last synced: 14 days ago
JSON representation
Get system's package manager and the availability of certain commands. Test rust library for a course.
- Host: GitHub
- URL: https://github.com/gomezmig03/pak-command
- Owner: GomezMig03
- License: mit
- Created: 2024-09-01T23:23:56.000Z (4 months ago)
- Default Branch: master
- Last Pushed: 2024-09-25T12:19:00.000Z (3 months ago)
- Last Synced: 2024-12-04T19:43:35.783Z (18 days ago)
- Language: Rust
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Pak-command
Library to get os package manager, name of distro or to know if system has specific commands.## Usage
### The ```package_manager``` function returns the system's package manager, if there is one.
#### Example
```
use pak_command::package_manager;
let pm: &str = package_manager();
println!("Your system's package manager is {}!", pm);
```
### The ```check_command``` function returns if the given command name exists in current system.
#### Example
```
use pak_command::check_command;
let first_command: &str = "cd";
let second_command: &str = "unexisting_command";
check_command(first_command); //true
check_command(second_command); //false
```
### The ```get_os``` function returns current os/distro as a String.
#### Example
```
use pak_command::get_os;
let user_os = get_os();
println!("Your operative system is {}", user_os);
```