Skip to content
Snippets Groups Projects
Select Git revision
  • master
  • Q5
  • Q4
  • Q3
  • Q2
  • Q1
6 results

build.gradle

Blame
  • Forked from Jean-Marie Place / m4104_2021_ctp
    Source project has a limited visibility.
    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(())
    }