diff --git a/src/bin/main.rs b/src/bin/main.rs index ab0256d..e6b7c95 100644 --- a/src/bin/main.rs +++ b/src/bin/main.rs @@ -79,39 +79,17 @@ fn main() { // Manage subcommands // NOTICE: Do not add else statement to catch unexpecteds since this is handled by clap // FIXME: Convert this on 'for loop' looking for available subcommands to avoid hardcoding + // FIXME-QA: Ugly? if let Some(_matches) = matches.subcommand_matches("resolve") { - zernit::subcoms::resolve::rustlang::resolve::resolve; + zernit::subcoms::resolve::rustlang::resolve::resolve(); } else if let Some(_matches) = matches.subcommand_matches("list") { - fixme!("Output installed packages"); - unimplemented!("Listing is not yet implemented"); + zernit::subcoms::list::rustlang::list::list(); } else if let Some(_matches) = matches.subcommand_matches("deploy") { - // ABSTRACT: This is expected to be the installation method for the end-users to get OS with (WIP-NAME) - fixme!("Deploy on target"); - fixme!("Deploy based on ENV variable -> ROOT='somepath' exports packages in somepath treating it as root"); - fixme!("Deploy based on config file"); - fixme!("Allow selection of file system hierarchy from CLI args"); - fixme!("Deploy kernel based on CLI args"); - fixme!("Deploy toolchain based on CLI args"); - fixme!("Deploy features"); - fixme!("Expected feature: Kreyrock (bedrock)"); - fixme!("Expected feature: winehq for unix"); - unimplemented!("Listing is not yet implemented"); - } else if let Some(_matches) = matches.subcommand_matches("deploy") { - fixme!("Perform sanity-checks for hijacking"); - fixme!("Hijack apt"); - fixme!("Hijack pacman"); - fixme!("Hijack portage"); - fixme!("Hijack dnf"); - fixme!("Hijack zypper"); - fixme!("Hijack freebsd pckm"); - fixme!("Hijack MacOS"); - fixme!("Hijack Windows?"); - fixme!("Die if untested system is parsed"); - fixme!("Die if used on invalid directory (suggest deploy instead?)"); - unimplemented!("Hijacking is not yet supported"); + zernit::subcoms::deploy::rustlang::deploy::deploy(); + } else if let Some(_matches) = matches.subcommand_matches("hijack") { + zernit::subcoms::hijack::rustlang::hijack::hijack(); } else if let Some(_matches) = matches.subcommand_matches("remove") { - fixme!("Remove package from specified root"); - unimplemented!("Removal of packages from specified root is not yet supported"); + zernit::subcoms::remove::rustlang::remove::remove(); } fixme!("Returns 0 even when no argument was parsed -> Expecting Exit 2 with help message"); diff --git a/src/lib.rs b/src/lib.rs index 6f33373..a98fef2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -14,4 +14,25 @@ pub mod subcoms { pub mod resolve; } } -} \ No newline at end of file +} +pub mod subcoms { + pub mod remove { + pub mod rustlang { + pub mod remove; + } + } +} +pub mod subcoms { + pub mod list { + pub mod rustlang { + pub mod list; + } + } +} +pub mod subcoms { + pub mod deploy { + pub mod rustlang { + pub mod deploy; + } + } +} diff --git a/src/subcoms/deploy/rustlang/deploy.rs b/src/subcoms/deploy/rustlang/deploy.rs new file mode 100644 index 0000000..f25e174 --- /dev/null +++ b/src/subcoms/deploy/rustlang/deploy.rs @@ -0,0 +1,15 @@ +use zernit_logger::fixme; + +pub fn deploy() { + // ABSTRACT: This is expected to be the installation method for the end-users to get OS with (WIP-NAME) + fixme!("Deploy on target"); + fixme!("Deploy based on ENV variable -> ROOT='somepath' exports packages in somepath treating it as root"); + fixme!("Deploy based on config file"); + fixme!("Allow selection of file system hierarchy from CLI args"); + fixme!("Deploy kernel based on CLI args"); + fixme!("Deploy toolchain based on CLI args"); + fixme!("Deploy features"); + fixme!("Expected feature: Kreyrock (bedrock)"); + fixme!("Expected feature: winehq for unix"); + unimplemented!("Listing is not yet implemented"); +} \ No newline at end of file diff --git a/src/subcoms/hijack/rustlang/hijack.rs b/src/subcoms/hijack/rustlang/hijack.rs new file mode 100644 index 0000000..ea8c345 --- /dev/null +++ b/src/subcoms/hijack/rustlang/hijack.rs @@ -0,0 +1,16 @@ +use zernit_logger::fixme; + +pub fn hijack() { + fixme!("Perform sanity-checks for hijacking"); + fixme!("Hijack apt"); + fixme!("Hijack pacman"); + fixme!("Hijack portage"); + fixme!("Hijack dnf"); + fixme!("Hijack zypper"); + fixme!("Hijack freebsd pckm"); + fixme!("Hijack MacOS"); + fixme!("Hijack Windows?"); + fixme!("Die if untested system is parsed"); + fixme!("Die if used on invalid directory (suggest deploy instead?)"); + unimplemented!("Hijacking is not yet supported"); +} \ No newline at end of file diff --git a/src/subcoms/list/rustlang/list.rs b/src/subcoms/list/rustlang/list.rs new file mode 100644 index 0000000..0692ae7 --- /dev/null +++ b/src/subcoms/list/rustlang/list.rs @@ -0,0 +1,6 @@ +use zernit_logger::fixme; + +pub fn hijack() { + fixme!("Output installed packages"); + unimplemented!("Listing is not yet implemented"); +} \ No newline at end of file diff --git a/src/subcoms/remove/rustlang/remove.rs b/src/subcoms/remove/rustlang/remove.rs new file mode 100644 index 0000000..6876015 --- /dev/null +++ b/src/subcoms/remove/rustlang/remove.rs @@ -0,0 +1,6 @@ +use zernit_logger::fixme; + +pub fn resolve() { + fixme!("Remove package from specified root"); + unimplemented!("Removal of packages from specified root is not yet supported"); +} \ No newline at end of file diff --git a/src/subcoms/resolve/rustlang/mod.rs b/src/subcoms/resolve/rustlang/mod.rs deleted file mode 100644 index 541130e..0000000 --- a/src/subcoms/resolve/rustlang/mod.rs +++ /dev/null @@ -1,6 +0,0 @@ -/* - File used for declaring modules as subcommands for zernif -*/ - -// Resolution of packages -//pub mod resolve; \ No newline at end of file