Skip to content

Commit eaaa649

Browse files
committed
make it better now
1 parent daa680e commit eaaa649

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ Give information to us with terminal (Don't be afraid, it's very easy):
77

88
If you want it to setup automantic, here is a command (If you are using Windows, please add .exe after the file name, like `./Minecraft-server-auto-setup.exe`):
99
```
10-
./Minecraft-server-auto-setup --software=Paper --version=1.21.1 --eula=true
10+
./Minecraft-server-auto-setup --software=paper --mc-version=1.21.1 --eula=true -y
1111
```

Diff for: src/main.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,18 @@ fn inquired<T>(binding: Result<T, inquire::InquireError>) -> T {
5151
impl Software {
5252
fn from_name(name: String) -> Self {
5353
match name.as_str() {
54-
"Paper" => Self::Paper,
55-
"Folia" => Self::Folia,
56-
"Purpur" => Self::Purpur,
54+
"paper" => Self::Paper,
55+
"folia" => Self::Folia,
56+
"purpur" => Self::Purpur,
5757
_ => panic!("Invalid software name: {}", name),
5858
}
5959
}
6060

6161
fn name(&self) -> String {
6262
match self {
63-
Self::Paper => "Paper",
64-
Self::Folia => "Folia",
65-
Self::Purpur => "Purpur",
63+
Self::Paper => "paper",
64+
Self::Folia => "folia",
65+
Self::Purpur => "purpur",
6666
}
6767
.to_string()
6868
}
@@ -94,7 +94,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
9494
)
9595
.prompt();
9696

97-
Software::from_name(inquired(binding).to_string())
97+
Software::from_name(inquired(binding).to_lowercase().to_string())
9898
} else {
9999
cli.software.unwrap()
100100
}

Diff for: src/softwares.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub fn get_other(software: String, version: String) -> Result<(), Box<dyn std::e
2828
let res = client
2929
.get(format!(
3030
"https://api.papermc.io/v2/projects/{}/versions/{}/builds",
31-
software.to_lowercase(), version
31+
software, version
3232
))
3333
.send();
3434

@@ -66,7 +66,7 @@ pub fn get_other(software: String, version: String) -> Result<(), Box<dyn std::e
6666

6767
pub fn get(name: String, version: String) -> Result<(), Box<dyn std::error::Error>> {
6868
match name.as_str() {
69-
"Purpur" => get_purpur(version),
69+
"purpur" => get_purpur(version),
7070
_ => get_other(name, version),
7171
}
7272
}

0 commit comments

Comments
 (0)