pub enum Verb {
Gen(GenArgs),
Plan(PlanArgs),
Apply(ApplyArgs),
Diff(DiffArgs),
Test(TestArgs),
Freeze(FreezeArgs),
Inject(InjectArgs),
Validate(ValidateArgs),
Watch(WatchArgs),
}Variants§
Gen(GenArgs)
Generate artifacts from a template directly
Examples: ggen project gen “rust-cli-template” –var name=myapp ggen project gen “web-api.tmpl” –dry-run ggen project gen “template.tmpl” –seed 12345
Plan(PlanArgs)
Create a machine-readable plan of changes without applying them (dry-run)
Examples: ggen project plan “rust-cli-template” –var name=myapp ggen project plan “template.tmpl” –format yaml
Apply(ApplyArgs)
Apply a previously generated plan to the filesystem
Examples: ggen project apply plan.json ggen project apply plan.yaml –dry-run
Diff(DiffArgs)
Show a unified diff of what a generation would change
Examples: ggen project diff “rust-cli-template” –var name=myapp ggen project diff “template.tmpl” –var version=1.0.0
Test(TestArgs)
Run golden file snapshot tests for templates
Examples: ggen project test “template.tmpl” –golden expected/ ggen project test “rust-cli.tmpl” –golden golden/ –update ggen project test “*.tmpl” –golden snapshots/ –json
Freeze(FreezeArgs)
Add freeze blocks to generated files for immutability
Examples: ggen project freeze “src/main.rs” –blocks “impl,business_logic” ggen project freeze “src/” –blocks “custom” –recursive ggen project freeze “app.ts” –blocks “config,routes” –dry-run
Inject(InjectArgs)
Inject code idempotently into existing files
Examples: ggen project inject “src/mod.rs” –anchor “// IMPORTS” –content “use foo;” ggen project inject “main.rs” –anchor “fn main()” –content “println!("hello");” –after ggen project inject “config.toml” –anchor “[dependencies]” –content “serde = "1.0"” –dry-run
Validate(ValidateArgs)
Validate plan files or generated output
Examples: ggen project validate plan.json ggen project validate generated/ –recursive ggen project validate output.rs –schema rust-file.schema.json ggen project validate plan.yaml –verbose –json
Watch(WatchArgs)
Watch templates and continuously regenerate on changes
Examples: ggen project watch “*.tmpl” –target src/ ggen project watch “templates/” –target output/ –recursive ggen project watch “api.tmpl” –target api/ –debounce 1000 –var env=dev
Trait Implementations§
Source§impl FromArgMatches for Verb
impl FromArgMatches for Verb
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>
ArgMatches to self.Source§fn update_from_arg_matches_mut<'b>(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§impl Subcommand for Verb
impl Subcommand for Verb
Source§fn augment_subcommands<'b>(__clap_app: Command) -> Command
fn augment_subcommands<'b>(__clap_app: Command) -> Command
Source§fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§fn has_subcommand(__clap_name: &str) -> bool
fn has_subcommand(__clap_name: &str) -> bool
Self can parse a specific subcommandAuto Trait Implementations§
impl Freeze for Verb
impl RefUnwindSafe for Verb
impl Send for Verb
impl Sync for Verb
impl Unpin for Verb
impl UnwindSafe for Verb
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
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request