Skip to content

Commit

Permalink
Use argh instead of clap
Browse files Browse the repository at this point in the history
  • Loading branch information
rossmacarthur committed Jul 15, 2023
1 parent 6612086 commit ad0f1ea
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 208 deletions.
217 changes: 23 additions & 194 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ edition = "2021"
publish = false

[dependencies]
anyhow = "1.0.54"
clap = { version = "3.1.1", features = ["derive"] }
anyhow = "1.0.71"
argh = "0.1.10"
upon = "0.6.0"

[[bin]]
Expand Down
19 changes: 7 additions & 12 deletions render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,23 @@ use std::fs;
use std::path::PathBuf;

use anyhow::{anyhow, Context};
use clap::Parser;
use argh::FromArgs;

const TEMPLATE: &str = include_str!("docker/Dockerfile");

/// Renders a Dockerfile at `docker/Docker.<target>`.
///
/// This is a simple tool to render Dockerfiles that will be published as Docker
/// images for use with [`sheldon`]'s CI.
///
/// [`sheldon`]: https://github.com/rossmacarthur/sheldon
#[derive(Debug, Parser)]
#[derive(Debug, FromArgs)]
struct Opts {
/// The target triple.
#[clap(long)]
/// the target triple.
#[argh(option)]
target: String,
/// OpenSSL install args.
#[clap(long)]
/// the OpenSSL install args.
#[argh(option)]
install_openssl_args: String,
}

fn main() -> anyhow::Result<()> {
let opts = Opts::parse();
let opts: Opts = argh::from_env();

let data = upon::value! {
target: &opts.target,
Expand Down

0 comments on commit ad0f1ea

Please sign in to comment.