You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.2 KiB
Rust
53 lines
1.2 KiB
Rust
mod download;
|
|
mod query;
|
|
mod list;
|
|
mod remove;
|
|
mod repository;
|
|
mod install;
|
|
mod package;
|
|
|
|
use meowhash::*;
|
|
use reqwest::*;
|
|
use sled::*;
|
|
use clap::*;
|
|
|
|
fn main() {
|
|
let operation = std::env::args().nth(1).expect("too few arguments!");
|
|
let args: String = std::env::args().collect();
|
|
match operation.as_str() {
|
|
"upgrade" | "u" => {
|
|
|
|
}
|
|
"install" | "i" => {
|
|
if std::env::args().nth(2).expect("too few arguments!") == "--local" {
|
|
|
|
} else {
|
|
let package_name = std::env::args().nth(2).expect("too few arguments!");
|
|
println!("Reading package list");
|
|
let package_list = sled::open("/var/gaypack/packages").expect("Failed to open package list");
|
|
if package_list.contains_key(package_name).expect("Unexpected error") {
|
|
println!("Package was found in package list, checking for updates");
|
|
}
|
|
}
|
|
}
|
|
"remove" | "r" => {
|
|
|
|
}
|
|
"list" | "l" => {
|
|
|
|
}
|
|
"query" | "q" => {
|
|
|
|
}
|
|
"repository" | "repo" => {
|
|
|
|
}
|
|
_ => {
|
|
panic!("Unknown operation: {}", operation);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|