mirror of
https://github.com/encounter/decomp-toolkit.git
synced 2025-12-12 06:45:09 +00:00
Add disc commands: info, extract, convert, verify
Utilizing https://github.com/encounter/nod-rs
This commit is contained in:
13
src/cmd/disc.rs
Normal file
13
src/cmd/disc.rs
Normal file
@@ -0,0 +1,13 @@
|
||||
use anyhow::{Error, Result};
|
||||
use argp::FromArgs;
|
||||
use nodtool::SubCommand;
|
||||
|
||||
#[derive(FromArgs, Debug)]
|
||||
/// Commands for processing disc images.
|
||||
#[argp(subcommand, name = "disc")]
|
||||
pub struct Args {
|
||||
#[argp(subcommand)]
|
||||
command: SubCommand,
|
||||
}
|
||||
|
||||
pub fn run(args: Args) -> Result<()> { nodtool::run(args.command).map_err(Error::new) }
|
||||
@@ -1,6 +1,7 @@
|
||||
pub mod alf;
|
||||
pub mod ar;
|
||||
pub mod demangle;
|
||||
pub mod disc;
|
||||
pub mod dol;
|
||||
pub mod dwarf;
|
||||
pub mod elf;
|
||||
|
||||
@@ -56,7 +56,7 @@ impl FromArgValue for LogLevel {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(FromArgs, PartialEq, Debug)]
|
||||
#[derive(FromArgs, Debug)]
|
||||
/// Yet another GameCube/Wii decompilation toolkit.
|
||||
struct TopLevel {
|
||||
#[argp(subcommand)]
|
||||
@@ -70,18 +70,20 @@ struct TopLevel {
|
||||
log_level: Option<LogLevel>,
|
||||
/// Print version information and exit.
|
||||
#[argp(switch, short = 'V')]
|
||||
#[allow(dead_code)]
|
||||
version: bool,
|
||||
/// Disable color output. (env: NO_COLOR)
|
||||
#[argp(switch)]
|
||||
no_color: bool,
|
||||
}
|
||||
|
||||
#[derive(FromArgs, PartialEq, Debug)]
|
||||
#[derive(FromArgs, Debug)]
|
||||
#[argp(subcommand)]
|
||||
enum SubCommand {
|
||||
Alf(cmd::alf::Args),
|
||||
Ar(cmd::ar::Args),
|
||||
Demangle(cmd::demangle::Args),
|
||||
Disc(cmd::disc::Args),
|
||||
Dol(cmd::dol::Args),
|
||||
Dwarf(cmd::dwarf::Args),
|
||||
Elf(cmd::elf::Args),
|
||||
@@ -155,6 +157,7 @@ fn main() {
|
||||
SubCommand::Alf(c_args) => cmd::alf::run(c_args),
|
||||
SubCommand::Ar(c_args) => cmd::ar::run(c_args),
|
||||
SubCommand::Demangle(c_args) => cmd::demangle::run(c_args),
|
||||
SubCommand::Disc(c_args) => cmd::disc::run(c_args),
|
||||
SubCommand::Dol(c_args) => cmd::dol::run(c_args),
|
||||
SubCommand::Dwarf(c_args) => cmd::dwarf::run(c_args),
|
||||
SubCommand::Elf(c_args) => cmd::elf::run(c_args),
|
||||
|
||||
Reference in New Issue
Block a user