summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2023-04-25 19:34:09 +0300
committerLars Wirzenius <liw@liw.fi>2023-04-25 19:34:09 +0300
commit8623a2d5234dfedf73788d99ab10fbcc875b7477 (patch)
treea33f8a1d6166ab91e39732f46335efa177e72266 /src
parentf0f341763b98a06a1e1068e16779bbe397eea8ed (diff)
downloadroadmap-8623a2d5234dfedf73788d99ab10fbcc875b7477.tar.gz
feat! drop roadmap2dot binary from crate
Sponsored-by: author
Diffstat (limited to 'src')
-rw-r--r--src/bin/roadmap2dot.rs44
1 files changed, 0 insertions, 44 deletions
diff --git a/src/bin/roadmap2dot.rs b/src/bin/roadmap2dot.rs
deleted file mode 100644
index e92f41d..0000000
--- a/src/bin/roadmap2dot.rs
+++ /dev/null
@@ -1,44 +0,0 @@
-//! Command line program to convert a roadmap from a named YAML input
-//! file to SVG, written to the standard output.
-//!
-//! Example
-//!
-//! ~~~sh
-//! roadmap2svg foo.yaml > foo.svg
-//! ~~~
-//!
-//! The command line program mostly exists just to make it easier to
-//! test the library crate. It is expected that serious use of the
-//! crate will be as a library.
-
-use anyhow::Result;
-use clap::Parser;
-use roadmap::from_yaml;
-use std::fs::File;
-use std::io::Read;
-use std::path::PathBuf;
-
-const LABEL_WIDTH: usize = 20;
-
-#[derive(Debug, Parser)]
-#[clap(
- name = "roadmap2dot",
- about = "Create a dot graph of a roadmap in YAML"
-)]
-struct Opt {
- /// The input filename.
- filename: PathBuf,
-}
-
-fn main() -> Result<()> {
- let opt = Opt::from_args();
- let mut text = String::new();
- let mut f = File::open(opt.filename)?;
- f.read_to_string(&mut text)?;
-
- let mut r = from_yaml(&text)?;
- r.set_missing_statuses();
- println!("{}", r.format_as_dot(LABEL_WIDTH).unwrap());
-
- Ok(())
-}