Skip to content

Option<Vec<T> as argument #180

@aurabindo

Description

@aurabindo

Hi,

An argument with Option<Vec> does not seem to work. Are there any workarounds ?

#[derive(StructOpt, Debug)]
pub enum DevCmds {
    #[structopt(name = "list", alias = "show")]
    Cmd1 {
        optional_args: Option<Vec<String>>,
    },

This produces errors like:

error[E0277]: the trait bound `std::vec::Vec<T>: std::str::FromStr` is not satisfied

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementWe would love to have this feature! Feel free to supply a PR

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions