Skip to content
Snippets Groups Projects
Commit e7d27ef4 authored by Michael Hauspie's avatar Michael Hauspie
Browse files

Initial setup of the crate architecture

parents
No related branches found
No related tags found
No related merge requests found
/target
Damien Amara <damien.amara@univ-lille.fr>
Michaël Hauspie <michael.hauspie@univ-lille.fr>
Gilles Grimaud <gilles.grimaud@univ-lille.fr>
This diff is collapsed.
[package]
name = "pip-tool"
version = "0.1.0"
edition = "2021"
authors = ["Michaël Hauspie <michael.hauspie@univ-lille.fr>", "Damien Amara <damien.amara@univ-lille.fr", "Gilles Grimaud <gilles.grimaud@univ-lille.fr>"]
license-file = "LICENSE"
description = "A tool to help creating and building a piece of software that can be run over the Pip protokernel"
repository = "https://gitlab.univ-lille.fr/2xs/pip/pip-tool.git"
homepage = "https://pip.univ-lille.fr"
readme = "README.md"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[[bin]]
path = "src/main.rs"
name = "pip-tool"
[dependencies]
anyhow = "1.0.81"
cargo-scaffold = "0.12.0"
clap = "4.5.2"
This diff is collapsed.
`pip-tool` is a command to ease the process of developping and
building a piece of software that can be run as a partition in the
[Pip](https://pip.univ-lille.fr) protokernel.
# Installation
To install this software, you must have a running
[Rust](https://www.rust-lang.org/learn/get-started) environnement and install it using
```sh
cargo install pip-tool
```
//! This modules implements the subcommand that creates a new project from a template
//!
//! Internally, it uses cargo-scaffold to create a new folder from a git template
use clap::Parser;
use std::path::PathBuf;
use anyhow::Result;
#[derive(Parser, Debug)]
pub struct Opts {
/// The path where to generate your project
project_path: PathBuf
}
const PIP_MPU_TEMPLATE_PATH: &str = "https://gitlab.univ-lille.fr/2xs/pip/pipcore-mpu-rust-crt0.git";
pub fn generate(opts: Opts) -> Result<()> {
todo!("{opts:#?}");
}
#![doc = include_str!("../README.md")]
mod generate;
use anyhow::Result;
use clap::{Parser, Subcommand};
#[derive(Parser, Debug)]
#[command(version, about, long_about = None)]
pub struct Opts {
#[command(subcommand)]
command: PipToolSubcommand,
}
#[derive(Subcommand, Debug)]
pub enum PipToolSubcommand {
/// Generate a new pip partition project
Generate(generate::Opts),
}
pub fn execute(opts: Opts) -> Result<()> {
match opts.command {
PipToolSubcommand::Generate(gen_opts) => generate::generate(gen_opts)?
}
Ok(())
}
#![doc = include_str!("../README.md")]
use clap::Parser;
use pip_tool::{Opts,execute};
use anyhow::Result;
fn main() -> Result<()> {
let opts = Opts::parse();
execute(opts)?;
Ok(())
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment