Skip to content

Multiple attributes for partial struct #187

Description

@rovo-dave

I would like to use clap with schematic and have figured out most things. One thing I can't figure out is how to pass multiple attributes to the partial config.

When doing this, everything is ok.

#[derive(schematic::Config)]
#[config(partial(derive(clap::Parser)))]

But when I want to pass a second attribute to the partial I get errors about the partial not deriving clap, indicating the pass through is not working.

#[derive(schematic::Config)]
#[config(partial(derive(clap::Parser)))]
#[config(partial(command(about = "Blah")))]

I have also tried other syntax with no luck:

#[derive(schematic::Config)] 
#[config(
    partial(derive(clap::Parser)),
    partial(command(about = "Blah")),
)]

and

#[derive(schematic::Config)]  
#[config(partial(
    derive(clap::Parser),
    command(about = "Blah-case")
))]

Looking at the schematic code, it looks like it doesn't maintain an array of attributes. Is this correct or am I doing something wrong?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions