Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cb605d12 authored by David Duarte's avatar David Duarte
Browse files

Revert "Migrate pdl from structopt to clap 3"

This reverts commit 1c8ae9c16c9551cf548028387569e4d73b92d394.

Change-Id: I0543e12ff5711e73bfdba3671b2b5314dbd5a1eb
Merged-In: I23fa9220208afa9e0832f94b1a25d3f13dd40d00
parent e7d9f704
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -11,7 +11,6 @@ rust_defaults {
    name: "pdl_defaults",
    // LINT.IfChange
    rustlibs: [
        "libclap",
        "libcodespan_reporting",
        "libheck",
        "libpest",
@@ -19,6 +18,7 @@ rust_defaults {
        "libquote",
        "libserde",
        "libserde_json",
        "libstructopt",
        "libsyn",
        "libtempfile",
    ],
+1 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ proc-macro2 = "1.0.46"
quote = "1.0.21"
serde_json = "1.0.86"
clap = { version = "3.2.22", features = ["derive"] }
structopt = "0.3.26"
syn = "1.0.102"

[dependencies.serde]
+6 −6
Original line number Diff line number Diff line
//! PDL parser and analyzer.

use clap::Parser;
use codespan_reporting::term::{self, termcolor};
use structopt::StructOpt;

mod analyzer;
mod ast;
@@ -33,20 +33,20 @@ impl std::str::FromStr for OutputFormat {
    }
}

#[derive(Parser, Debug)]
#[clap(name = "pdl-parser", about = "Packet Description Language parser tool.")]
#[derive(Debug, StructOpt)]
#[structopt(name = "pdl-parser", about = "Packet Description Language parser tool.")]
struct Opt {
    /// Print tool version and exit.
    #[clap(short, long = "--version")]
    #[structopt(short, long = "--version")]
    version: bool,

    /// Generate output in this format ("json", "rust", "rust_no_alloc", "rust_no_alloc_test"). The output
    /// will be printed on stdout in both cases.
    #[clap(short, long = "--output-format", name = "FORMAT", default_value = "JSON")]
    #[structopt(short, long = "--output-format", name = "FORMAT", default_value = "JSON")]
    output_format: OutputFormat,

    /// Input file.
    #[clap(name = "FILE")]
    #[structopt(name = "FILE")]
    input_file: String,
}