Skip to content

Commit

Permalink
big changes moving commands around
Browse files Browse the repository at this point in the history
  • Loading branch information
HJfod committed Feb 26, 2023
1 parent a41ddc9 commit 67fe0e3
Show file tree
Hide file tree
Showing 9 changed files with 460 additions and 427 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "geode"
version = "1.6.0"
version = "2.0.0"
authors = ["HJfod <dreadrollmusic@gmail.com>", "Camila314 <ilaca314@gmail.com>"]
edition = "2021"
build = "build.rs"
Expand Down
1 change: 0 additions & 1 deletion src/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,6 @@ fn create_entry(out_path: &Path) {
pub fn subcommand(config: &mut Config, cmd: Index) {
match cmd {
Index::New { output } => create_entry(&output),

Index::Update => update_index(config),
}
}
3 changes: 1 addition & 2 deletions src/indexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ fn export_mod(package: PathBuf) {
info!("git -C {} push -f", indexer_path.to_str().unwrap());
}


pub fn subcommand(_config: &mut Config, cmd: Indexer) {
match cmd {
Indexer::Init => initialize(),
Expand All @@ -167,4 +166,4 @@ pub fn subcommand(_config: &mut Config, cmd: Indexer) {

Indexer::Export { package } => export_mod(package)
}
}
}
44 changes: 14 additions & 30 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,58 +25,43 @@ struct Args {

#[derive(Subcommand, Debug)]
enum GeodeCommands {
/// Create template mod project
/// Initialize a new Geode project
New {
/// Mod project directory
#[clap(short, long)]
path: Option<PathBuf>,

/// Mod name
#[clap(short, long)]
name: Option<String>,

/// Remove all tutorial comments from template
#[clap(short, long)]
strip: bool
},

/// Install a .geode package to current profile, alias of `geode package install`
Install {
/// Location of the .geode package to install
path: PathBuf,
/// The target directory to create the project in
path: Option<PathBuf>
},

/// Subcommand for managing profiles
/// Options for managing profiles (installations of Geode)
Profile {
#[clap(subcommand)]
commands: crate::profile::Profile,
},

/// Subcommand for managing configurable data
/// Options for configuring Geode CLI
Config {
#[clap(subcommand)]
commands: crate::info::Info,
},

/// Subcommand for managing the Geode SDK
/// Options for installing & managing the Geode SDK
Sdk {
#[clap(subcommand)]
commands: crate::sdk::Sdk,
},

/// Subcommand for managing Geode packages
Package {
/// Tools for working with the current mod project
Project {
#[clap(subcommand)]
commands: crate::package::Package,
commands: crate::project::Project,
},

/// Subcommand for working with the current mod project
Project {
/// Options for working with .geode packages
Package {
#[clap(subcommand)]
commands: crate::project::Project,
commands: crate::package::Package,
},

/// Subcommand for interacting with the Geode mod index
/// Tools for interacting with the Geode mod index
Index {
#[clap(subcommand)]
commands: crate::index::Index,
Expand Down Expand Up @@ -114,8 +99,7 @@ fn main() {
let mut config = config::Config::new();

match args.command {
GeodeCommands::New { name, path, strip } => template::build_template(&mut config, name, path, strip),
GeodeCommands::Install { path } => package::install(&mut config, &path),
GeodeCommands::New { path } => template::build_template(&mut config, path),
GeodeCommands::Profile { commands } => profile::subcommand(&mut config, commands),
GeodeCommands::Config { commands } => info::subcommand(&mut config, commands),
GeodeCommands::Sdk { commands } => sdk::subcommand(&mut config, commands),
Expand Down
Loading

0 comments on commit 67fe0e3

Please sign in to comment.