pub struct JsonSchemaCommand {
pub dir: PathBuf,
}Available on crate feature
terminal only.Expand description
Generate JSON Schemas of every command’s JSON output to the given directory.
This command allows you to generate one JSON Schema per command
describing the structure of its --json output, to the given
directory. If the directory does not exist, it will be created. Any
existing schema will be overriden.
Fields§
§dir: PathBufDirectory where JSON Schema files should be generated in.
Implementations§
Source§impl JsonSchemaCommand
impl JsonSchemaCommand
Sourcepub fn execute(
self,
printer: &mut impl Printer,
schemas: BTreeMap<String, Value>,
) -> Result<()>
pub fn execute( self, printer: &mut impl Printer, schemas: BTreeMap<String, Value>, ) -> Result<()>
Generates one <command>.json schema file per entry and reports
how many landed where.
The map is keyed by command name (e.g. himalaya-envelope-list)
and valued by the already-built JSON Schema of that command’s
output, mirroring how ManualCommand renders one man page per
subcommand. Callers own the command-to-schema mapping since the
output shapes live in the binary, not in this toolkit.
Trait Implementations§
Source§impl Args for JsonSchemaCommand
impl Args for JsonSchemaCommand
Source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Append to
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§impl CommandFactory for JsonSchemaCommand
impl CommandFactory for JsonSchemaCommand
Source§impl Debug for JsonSchemaCommand
impl Debug for JsonSchemaCommand
Source§impl FromArgMatches for JsonSchemaCommand
impl FromArgMatches for JsonSchemaCommand
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
Assign values from
ArgMatches to self.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
Assign values from
ArgMatches to self.Source§impl Parser for JsonSchemaCommand
impl Parser for JsonSchemaCommand
Source§fn parse_from<I, T>(itr: I) -> Self
fn parse_from<I, T>(itr: I) -> Self
Parse from iterator, exit on error.
Source§fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
Parse from iterator, return Err on error.
Source§fn update_from<I, T>(&mut self, itr: I)
fn update_from<I, T>(&mut self, itr: I)
Auto Trait Implementations§
impl Freeze for JsonSchemaCommand
impl RefUnwindSafe for JsonSchemaCommand
impl Send for JsonSchemaCommand
impl Sync for JsonSchemaCommand
impl Unpin for JsonSchemaCommand
impl UnsafeUnpin for JsonSchemaCommand
impl UnwindSafe for JsonSchemaCommand
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more