Add the project skeleton and the approved design
Cargo.toml with the release profile and lints, the toolchain pinned to Rust 1.90.0, a build script that records the git commit for `cumulus --version`, and rustfmt settings and cargo aliases (`cargo lint`, `cargo linux`) as in skyshift. DESIGN.md holds the design approved after the question rounds; README.md has build instructions and the planned keys. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
commit
0e03c396bf
12 files changed
+659
No files matched your search
+11
@@ -0,0 +1,11 @@
|
||||
//! cumulus: brainstorm in the terminal.
|
||||
//!
|
||||
//! cumulus is a program, not a library for other projects. It's split into a
|
||||
//! library and a small `main.rs` so the examples in `examples/` can run the
|
||||
//! same code while the app is being built (DESIGN.md, "Build order").
|
||||
|
||||
/// The line `cumulus --version` prints: the version, and the git commit it was
|
||||
/// built from (recorded by `build.rs`).
|
||||
pub fn version() -> String {
|
||||
format!("cumulus {} ({})", env!("CARGO_PKG_VERSION"), env!("CUMULUS_COMMIT"))
|
||||
}
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
//! cumulus: brainstorm in the terminal.
|
||||
//!
|
||||
//! This file only reads the command line. Everything else lives in the
|
||||
//! library: `src/lib.rs` lists the modules.
|
||||
|
||||
use std::process::ExitCode;
|
||||
|
||||
const USAGE: &str = "\
|
||||
cumulus: brainstorm in the terminal
|
||||
|
||||
Usage: cumulus
|
||||
|
||||
Options:
|
||||
-h, --help show this help
|
||||
-V, --version show the version";
|
||||
|
||||
fn main() -> ExitCode {
|
||||
let args: Vec<String> = std::env::args().skip(1).collect();
|
||||
match args.first().map(String::as_str) {
|
||||
None => {
|
||||
println!("cumulus is being built, one stage at a time: see DESIGN.md.");
|
||||
ExitCode::SUCCESS
|
||||
}
|
||||
Some("-h" | "--help") => {
|
||||
println!("{USAGE}");
|
||||
ExitCode::SUCCESS
|
||||
}
|
||||
Some("-V" | "--version") => {
|
||||
println!("{}", cumulus::version());
|
||||
ExitCode::SUCCESS
|
||||
}
|
||||
Some(other) => {
|
||||
eprintln!("cumulus: unknown option {other}\n\n{USAGE}");
|
||||
ExitCode::FAILURE
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user