Select Git revision
build.gradle
Forked from
Jean-Marie Place / m4104_2021_ctp
Source project has a limited visibility.
-
Jean-Marie Place authoredJean-Marie Place authored
lib.rs 726 B
#![doc = include_str!("../README.md")]
mod link;
mod new;
pub mod rel_iter;
pub mod symbols;
use anyhow::Result;
use clap::{Parser, Subcommand};
#[derive(Parser, Debug)]
#[command(version, about, long_about = None)]
pub struct Opts {
#[command(subcommand)]
command: TrollSubcommand,
}
#[derive(Subcommand, Debug)]
pub enum TrollSubcommand {
/// Generate a new project
New(new::Opts),
/// Link elf files together and generate a Troll binary blob ready to be flashed/loaded
Link(link::Opts),
}
pub fn execute(opts: Opts) -> Result<()> {
match opts.command {
TrollSubcommand::New(opts) => new::generate(opts)?,
TrollSubcommand::Link(opts) => link::link(opts)?,
}
Ok(())
}