From 946acf94f95145cb939569f646a53016ddce545a Mon Sep 17 00:00:00 2001 From: Lach Date: Wed, 26 Aug 2020 05:44:42 +0000 Subject: [PATCH] feat(cli): output file options --- --- a/crates/jrsonnet-cli/src/manifest.rs +++ b/crates/jrsonnet-cli/src/manifest.rs @@ -1,7 +1,7 @@ use crate::ConfigureState; use clap::Clap; use jrsonnet_evaluator::{error::Result, EvaluationState, ManifestFormat}; -use std::str::FromStr; +use std::{path::PathBuf, str::FromStr}; pub enum ManifestFormatName { /// Expect string as output, and write them directly @@ -66,3 +66,16 @@ Ok(()) } } + +#[derive(Clap)] +pub struct OutputOpts { + /// Write to the output file rather than stdout + #[clap(long, short = 'o')] + pub output_file: Option, + /// Automatically creates all parent directories for files + #[clap(long, short = 'c')] + pub create_output_dirs: bool, + /// Write multiple files to the directory, list files on stdout + #[clap(long, short = 'm')] + pub multi: Option, +} -- gitstuff