Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature subcommands #83

Merged
merged 5 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ pub enum Commands {
Setup,
/// Builds a new Minecraft Server Instance.
Build,
/// Starts the Minecraft Server.
/// Starts the Minecraft Server Instance.
Start,
/// Stops the Minecraft Server.
/// Stops the Minecraft Server Instance.
Stop,
/// Prints the logs of the latest run.
/// Prints the logs of the latest instance.
Log,
/// Gives debug information on Currently running server.
Check,
Expand Down
3 changes: 3 additions & 0 deletions src/check.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pub fn check(){
// TODO Build this
}
3 changes: 3 additions & 0 deletions src/get_url.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pub fn get_url() {
// TODO Build this
}
3 changes: 3 additions & 0 deletions src/log.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pub fn log() {
// TODO Build this
}
4 changes: 4 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ mod args;
mod start;
mod build;
mod setup;
mod log;
mod check;
mod stop;
mod get_url;
use run::Run;
fn main() {
println!("Hello, world!");
Expand Down
17 changes: 14 additions & 3 deletions src/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ use crate::args::{MCServer,Commands};
use crate::build::build;
use crate::setup::setup;
use crate::start::start_server;

use crate::stop::stop;
use crate::log::log;
use crate::check::check;
use crate::get_url::get_url;

impl Run {
pub fn new() {
Expand All @@ -17,8 +20,12 @@ impl Run {
Commands::Setup => setup(),
Commands::Build => build(),
Commands::Start => start_server(),

_ => println!("Nah didn't reach me bruh"),
Commands::Log => log(),
Commands::Check => check(),
Commands::Stop => stop(),
Commands::GetUrl => get_url(),
#[allow(unreachable_patterns)]
_ => println!("No Implementation found for this command"),
}

}
Expand All @@ -30,6 +37,10 @@ mod tests {

#[test]
fn run_has_std_practices() {
// Commented this test cause while parsing it fails
// Waits for a user subcommand and takes directly
// To help

//Run::new();
assert!(true);
}
Expand Down
3 changes: 3 additions & 0 deletions src/stop.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pub fn stop() {
// TODO Build this
}
Loading