Skip to content

Commit

Permalink
Added deprecated short flag for print-json in parse-tree (#345)
Browse files Browse the repository at this point in the history
* Added deprecated short flag for print-json in parse-tree

* Formatting changes

* Added docs

---------

Co-authored-by: Akshay Rane <raneaks@amazon.com>
  • Loading branch information
akshayrane and Akshay Rane committed Mar 23, 2023
1 parent 590d0d7 commit e0d7f6b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions guard/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ pub const INPUT_PARAMETERS: (&str, char) = ("input-parameters", 'i');
pub const PAYLOAD: (&str, char) = ("payload", 'P');
pub const PREVIOUS_ENGINE: (&str, char) = ("previous-engine", 'E');
pub const PRINT_JSON: (&str, char) = ("print-json", 'p');
pub const PRINT_JSON_DEPRECATED: char = 'j';
pub const SHOW_CLAUSE_FAILURES: (&str, char) = ("show-clause-failures", 's');
pub const SHOW_SUMMARY: (&str, char) = ("show-summary", 'S');
pub const TYPE: (&str, char) = ("type", 't');
Expand Down
5 changes: 3 additions & 2 deletions guard/src/commands/parse_tree.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::command::Command;
use crate::commands::{OUTPUT, PARSE_TREE, PRINT_JSON, PRINT_YAML, RULES};
use crate::commands::{OUTPUT, PARSE_TREE, PRINT_JSON, PRINT_JSON_DEPRECATED, PRINT_YAML, RULES};
use crate::rules::Result;
use crate::utils::reader::Reader;
use crate::utils::writer::Writer;
Expand Down Expand Up @@ -44,8 +44,9 @@ impl Command for ParseTree {
Arg::new(PRINT_JSON.0)
.long(PRINT_JSON.0)
.short(PRINT_JSON.1)
.short_alias(PRINT_JSON_DEPRECATED)
.action(ArgAction::SetTrue)
.help("Print output in JSON format"),
.help("Print output in JSON format. Use -p going forward, as the short flag -j is on deprecation path."),
)
.arg(
Arg::new(PRINT_YAML.0)
Expand Down

0 comments on commit e0d7f6b

Please sign in to comment.