Skip to content

Commit

Permalink
[CLI] default to human schema format (#750)
Browse files Browse the repository at this point in the history
Signed-off-by: Craig Disselkoen <cdiss@amazon.com>
  • Loading branch information
cdisselkoen committed Mar 27, 2024
1 parent 95e1b90 commit 57d3463
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions cedar-policy-cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## Unreleased

### Changed

- The default `--schema-format` is now `human` for all subcommands that take
`--schema-format`.

## 3.1.1

## 3.1.0
Expand Down
8 changes: 4 additions & 4 deletions cedar-policy-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ pub enum SchemaFormat {

impl Default for SchemaFormat {
fn default() -> Self {
Self::Json
Self::Human
}
}

Expand All @@ -151,7 +151,7 @@ pub struct ValidateArgs {
#[arg(long = "partial-validate")]
pub partial_validate: bool,
/// Schema format (Human-readable or json)
#[arg(long, value_enum, default_value_t = SchemaFormat::Json)]
#[arg(long, value_enum, default_value_t = SchemaFormat::Human)]
pub schema_format: SchemaFormat,
}

Expand Down Expand Up @@ -347,7 +347,7 @@ pub struct AuthorizeArgs {
#[arg(short, long = "schema", value_name = "FILE")]
pub schema_file: Option<String>,
/// Schema format (Human-readable or JSON)
#[arg(long, value_enum, default_value_t = SchemaFormat::Json)]
#[arg(long, value_enum, default_value_t = SchemaFormat::Human)]
pub schema_format: SchemaFormat,
/// File containing JSON representation of the Cedar entity hierarchy
#[arg(long = "entities", value_name = "FILE")]
Expand Down Expand Up @@ -462,7 +462,7 @@ pub struct EvaluateArgs {
#[arg(short, long = "schema", value_name = "FILE")]
pub schema_file: Option<String>,
/// Schema format (Human-readable or JSON)
#[arg(long, value_enum, default_value_t = SchemaFormat::Json)]
#[arg(long, value_enum, default_value_t = SchemaFormat::Human)]
pub schema_format: SchemaFormat,
/// File containing JSON representation of the Cedar entity hierarchy.
/// This is optional; if not present, we'll just use an empty hierarchy.
Expand Down

0 comments on commit 57d3463

Please sign in to comment.