oops forgot to make those pub

This commit is contained in:
Emma Tebibyte 2023-03-22 18:42:20 -04:00
parent 6dd9c4871d
commit 04a7f27dea
Signed by: emma
GPG Key ID: 6D661C738815E7DD
3 changed files with 24 additions and 36 deletions

12
.github/FUNDING.yml vendored
View File

@ -1,12 +0,0 @@
# These are supported funding model platforms
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: tebibytemedia # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: tebibytemedia # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

View File

@ -19,63 +19,63 @@
use core::str::FromStr;
use arg::Args;
pub use arg::Args;
#[derive(Args, Debug)]
struct Arguments {
pub struct Arguments {
#[arg(short = "v")]
v: bool,
pub v: bool,
#[arg(sub)]
sub: Command,
pub sub: Command,
}
#[derive(Args, Debug)]
struct InitArgs {
pub struct InitArgs {
#[arg(short = "d")]
dir: Option<String>,
pub dir: Option<String>,
#[arg(short = "f")]
template: Option<String>,
pub template: Option<String>,
#[arg(short = "m")]
mc_version: Vec<String>,
pub mc_version: Vec<String>,
#[arg(short = "t", required)]
package_type: PackageType,
pub package_type: PackageType,
}
#[derive(Args, Debug)]
struct HopArgs {
pub struct HopArgs {
#[arg(short = "f")]
hopfile: Option<String>,
pub hopfile: Option<String>,
#[arg(short = "m")]
mc_version: Vec<String>,
pub mc_version: Vec<String>,
#[arg(short = "t")]
package_type: Option<PackageType>,
pub package_type: Option<PackageType>,
}
#[derive(Args, Debug)]
struct SearchArgs {
package_name: String,
pub struct SearchArgs {
pub package_name: String,
/// Overrides the download directory
#[arg(short = "d")]
dir: Option<String>,
pub dir: Option<String>,
/// Restricts the target Minecraft version
#[arg(short = "m")]
mc_version: Vec<String>,
pub mc_version: Vec<String>,
/// Type of package to use
#[arg(short = "t")]
package_type: Option<PackageType>,
pub package_type: Option<PackageType>,
}
#[derive(Args, Debug)]
enum Command {
pub enum Command {
Add(SearchArgs),
Get(SearchArgs),
Init(InitArgs),
@ -85,7 +85,7 @@ enum Command {
}
#[derive(Debug)]
enum PackageType {
pub enum PackageType {
Mod(Loader),
Pack(Loader),
Plugin(Server),
@ -93,14 +93,14 @@ enum PackageType {
}
#[derive(Debug)]
enum Loader {
pub enum Loader {
Fabric,
Forge,
Quilt,
}
#[derive(Debug)]
enum Server {
pub enum Server {
Bukkit,
Paper,
Purpur,
@ -109,7 +109,7 @@ enum Server {
}
#[derive(Debug)]
enum PackageParseError {
pub enum PackageParseError {
Invalid(String),
}

View File

@ -32,5 +32,5 @@ use config::*;
#[tokio::main]
#[no_mangle]
async fn rust_main(args: c_main::Args) {
let argv: Vec<&str> = args.into_iter().collect();
let arguments = Arguments::from_args(args.into_iter());
}