Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "coreos-assembler"
version = "0.1.0"
authors = ["Colin Walters <walters@verbum.org>"]

[dependencies]
clap = "~2.28"
failure = "0.1.1"

[[bin]]
name = "coreos-assembler-rs"
path = "src/coreos-assembler.rs"
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
PREFIX ?= /usr
DESTDIR ?=

.PHONY: all mantle install
.PHONY: all rust mantle install

all: mantle
all: mantle rust

rust:
cargo build --release

mantle:
cd mantle && ./build ore kola kolet

install:
install -D -t $(DESTDIR)$(PREFIX)/bin coreos-assembler $$(find src/compat -maxdepth 1 -type f)
install -D -t $(DESTDIR)$(PREFIX)/libexec target/release/coreos-assembler-rs
install -D -t $(DESTDIR)$(PREFIX)/libexec/coreos-assembler $$(find src/ -maxdepth 1 -type f)
install -D -t $(DESTDIR)$(PREFIX)/bin mantle/bin/{ore,kola}
install -D -m 0755 -t $(DESTDIR)$(PREFIX)/lib/kola/amd64 mantle/bin/amd64/kolet
38 changes: 38 additions & 0 deletions src/coreos-assembler.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
extern crate clap;
#[macro_use]
extern crate failure;

use failure::Error;
use clap::{App, SubCommand};

fn hello() -> Result<(), Error> {
println!("🦀");
Ok(())
}

fn run() -> Result<(), Error> {
let matches = App::new("coreos-assembler")
.version("0.1")
.about("CoreOS assembler")
.subcommand(
SubCommand::with_name("hello")
.about("Say hello")
)
.get_matches();

match matches.subcommand() {
("hello", _) => hello(),
("", _) => bail!("No command given"),
_ => unreachable!(),
}
}

fn main() {
match run() {
Ok(_) => {}
Err(e) => {
eprintln!("{:?}", e);
std::process::exit(1)
}
}
}