use clap::Subcommand;
mod authorize;
pub use authorize::*;
mod evaluate;
pub use evaluate::*;
mod validate;
pub use validate::*;
mod check_parse;
pub use check_parse::*;
#[cfg(feature = "analyze")]
mod symcc;
pub use symcc::*;
#[cfg(feature = "tpe")]
mod tpe;
pub use tpe::*;
#[cfg(feature = "partial-eval")]
mod partial_eval;
pub use partial_eval::*;
mod run_test;
pub use run_test::*;
mod link;
pub use link::*;
mod format;
pub use format::*;
mod translate_policy;
pub use translate_policy::*;
mod translate_schema;
pub use translate_schema::*;
mod visualize;
pub use visualize::*;
mod new;
pub use new::*;
mod language_version;
pub use language_version::*;
#[cfg(not(feature = "tpe"))]
mod tpe {
use crate::CedarExitCode;
#[derive(Debug, clap::Args)]
pub struct TpeArgs;
pub fn tpe(_: &TpeArgs) -> CedarExitCode {
eprintln!("Error: subcommand `tpe` is experimental, but this executable was not built with `tpe` experimental feature enabled");
CedarExitCode::Failure
}
}
#[cfg(not(feature = "partial-eval"))]
mod partial_eval {
use crate::CedarExitCode;
#[derive(Debug, clap::Args)]
pub struct PartiallyAuthorizeArgs;
pub fn partial_authorize(_: &PartiallyAuthorizeArgs) -> CedarExitCode {
eprintln!("Error: subcommand `partially-authorize` is experimental, but this executable was not built with `partial-eval` experimental feature enabled");
CedarExitCode::Failure
}
}
#[cfg(not(feature = "analyze"))]
mod symcc {
use crate::CedarExitCode;
#[derive(Debug, clap::Args)]
pub struct SymccArgs;
pub fn symcc(_: &SymccArgs) -> CedarExitCode {
eprintln!("Error: subcommand `symcc` is experimental, but this executable was not built with `analyze` experimental feature enabled");
CedarExitCode::Failure
}
}
#[derive(Subcommand, Debug)]
pub enum Commands {
Authorize(AuthorizeArgs),
Evaluate(EvaluateArgs),
Validate(ValidateArgs),
CheckParse(CheckParseArgs),
Link(LinkArgs),
Format(FormatArgs),
TranslatePolicy(TranslatePolicyArgs),
TranslateSchema(TranslateSchemaArgs),
Visualize(VisualizeArgs),
New(NewArgs),
PartiallyAuthorize(PartiallyAuthorizeArgs),
Tpe(TpeArgs),
#[clap(verbatim_doc_comment)] RunTests(RunTestsArgs),
Symcc(SymccArgs),
LanguageVersion,
}