From c07057c7c43be0dbdd571f6446bc6150b42c896f Mon Sep 17 00:00:00 2001 From: Martin Geisler <mgeisler@google.com> Date: Fri, 1 Apr 2022 16:28:17 +0200 Subject: [PATCH] pdl: use docstrings instead of attribute arguments Editors typically have better support for editing text in docstrings than in attributes. Test: pdl --help Change-Id: I3b1062a188feb6d34d727442390bf1859270bf77 --- tools/pdl/src/main.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/pdl/src/main.rs b/tools/pdl/src/main.rs index 5f488fd61ed..7309f982d39 100644 --- a/tools/pdl/src/main.rs +++ b/tools/pdl/src/main.rs @@ -21,10 +21,12 @@ use crate::lint::Lintable; #[derive(Debug, StructOpt)] #[structopt(name = "pdl-parser", about = "Packet Description Language parser tool.")] struct Opt { - #[structopt(short, long = "--version", help = "Print tool version and exit.")] + /// Print tool version and exit. + #[structopt(short, long = "--version")] version: bool, - #[structopt(name = "FILE", help = "Input file.")] + /// Input file. + #[structopt(name = "FILE")] input_file: String, } -- GitLab