google / google/argh

Help comment is unexpectedly mangled

Open
#121 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
2k
Forks
102
PR merge metrics
No merged PRs in 30d

Description

I wrote the following code. I think it's a reasonable thing to do:

```
struct Opts {
/// the target to build. One of:
///
/// * clean Clean everything (including node_modules)
/// * client Build the Typescript extension client
/// * isa Build the ISA processing tool
/// * isa_generate Use the ISA processing tool to generate the Rust code
/// * npm_install Run NPM install
/// * package Generate the VSIX package
/// * release Clean and rebuild everything and make a package
/// * server Build the Rust language server
/// * tree_sitter_generate Generate the Tree-Sitter C code from the grammar
#[argh(positional)]
target: Target,
```

Unfortunately it gets rendered in `--help` like this:

```
Positional Arguments:
target the target to build. One of: * clean Clean
everything (including node_modules) * client
Build the Typescript extension client * isa
Build the ISA processing tool * isa_generate Use
the ISA processing tool to generate the Rust code *
npm_install Run NPM install * package
Generate the VSIX package * release Clean and
rebuild everything and make a package * server
Build the Rust language server * tree_sitter_generate
Generate the Tree-Sitter C code from the grammar
```

It seems like argh strips each line and then joins them into one string. I think that's a bit unexpected. Probably worth checking what structopt does.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.