Skip to content

Commit

Permalink
--tolerate-parsing-errors doesn't make sense for visualisation
Browse files Browse the repository at this point in the history
  • Loading branch information
Xophmeister committed Aug 15, 2023
1 parent 677c37c commit 8de5685
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 23 deletions.
6 changes: 2 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,7 @@ topiary --visualise[=FORMAT] \

After:
```
topiary vis [--tolerate-parsing-errors] \
[--format FORMAT] \
topiary vis [--format FORMAT] \
INPUT_FILE \
[> OUTPUT_FILE]
```
Expand All @@ -150,8 +149,7 @@ topiary --visualise[=FORMAT] \

After (use IO redirection):
```
topiary vis [--tolerate-parsing-errors] \
[--format FORMAT] \
topiary vis [--format FORMAT] \
(--langauge LANGUAGE | --query QUERY) \
< INPUT_FILE \
[> OUTPUT_FILE]
Expand Down
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,6 @@ Arguments:
Input file (omit to read from stdin)
Options:
-t, --tolerate-parsing-errors
Consume as much as possible in the presence of parsing errors
-f, --format <FORMAT>
Visualisation format
Expand Down
17 changes: 3 additions & 14 deletions topiary-cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,6 @@ pub struct GlobalArgs {
pub configuration_collation: Option<configuration::CollationMode>,
}

// These are "parser" global arguments; i.e., those that are relevant to all subcommands that will
// parse input. They will need to be added to all such subcommands, with #[command(flatten)].
#[derive(Args, Debug)]
pub struct ParseArgs {
/// Consume as much as possible in the presence of parsing errors
#[arg(short, long)]
tolerate_parsing_errors: bool,
}

#[derive(Debug, Subcommand)]
pub enum Commands {
/// Format inputs
Expand All @@ -76,8 +67,9 @@ pub enum Commands {
.args(&["language", "query", "files"])
)]
Fmt {
#[command(flatten)]
parse: ParseArgs,
/// Consume as much as possible in the presence of parsing errors
#[arg(short, long)]
tolerate_parsing_errors: bool,

/// Do not check that formatting twice gives the same output
#[arg(short, long)]
Expand Down Expand Up @@ -109,9 +101,6 @@ pub enum Commands {
.args(&["language", "query", "file"])
)]
Vis {
#[command(flatten)]
parse: ParseArgs,

/// Visualisation format
#[arg(short, long, default_value = "dot")]
format: visualisation::Format,
Expand Down
3 changes: 1 addition & 2 deletions topiary-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ async fn run() -> CLIResult<()> {
// Delegate by subcommand
match args.command {
Commands::Fmt {
parse,
tolerate_parsing_errors,
skip_idempotence,
language,
query,
Expand All @@ -53,7 +53,6 @@ async fn run() -> CLIResult<()> {
}

Commands::Vis {
parse,
format,
language,
query,
Expand Down

0 comments on commit 8de5685

Please sign in to comment.