-foo' which wasn't expected, or isn't valid in this context
app --foo <foo> get 代码: use structopt::*;
#[structopt(name = "app")] #[structopt(long)]foo: String,
#[s
我希望能够在我的命令行工具中使用“通用”标志,它使用StructOpt。这是我的main.rs代码: use std::str::FromStr;use std::io::{Error, ErrorKind};
/// Specific task being executed; one task might imply others, depending on flags(short
如果在StructOpt中定义了Opt结构,我可以使用main.rs解析命令行参数,但是由于我希望能够将Opt结构传递到库代码中,所以我在自己的文件中定义它,以便库的其他部分知道它的全部内容。::clap`help: consider importing this struct3 | use opt::structopt::clap::Arg;src/main.rsextern crate structopt</em
我使用StructOpt来获取用户想要搜索的单词。#[derive(Debug, StructOpt)] pub word_to_search: Option<String>,当您编写类似于command: Found argument '-a' which wasn't expected, or isn't valid in this context
有没有一种方法可以传递像-a这样的特殊字符并使用StructOpt