#![deny(missing_docs, missing_debug_implementations)]
extern crate cargo_metadata;
extern crate duct;
extern crate shell_words;
#[macro_use]
extern crate structopt;
extern crate which;
mod command;
use std::path::PathBuf;
use structopt::StructOpt;
#[derive(StructOpt)]
#[structopt(
name = "hull",
about = "Compiles crates, binaries, and examples in a workspace.",
raw(global_setting = "structopt::clap::AppSettings::ColoredHelp")
)]
struct Opt {
#[structopt(
long = "manifest-path",
default_value = "./Cargo.toml",
help = "Path to the workspace or crate Cargo.toml",
parse(from_os_str)
)]
manifest_path: PathBuf,
#[structopt(subcommand)]
cmd: command::Entry,
}
fn main() {
let opt = Opt::from_args();
let manifest_path = opt.manifest_path.canonicalize().unwrap();
opt.cmd
.command(&manifest_path)
.run()
.expect("Failed to execute command");
}