Coder Social home page Coder Social logo

Comments (2)

workabyte avatar workabyte commented on September 4, 2024

i believe the issue found here #47
may solve for what you are looking to do. With the example you provided you would want to do something like

public class SampleArgs
{
[ArgCantBeCombinedWith("B")]
public bool A { get; set; }
[ArgCantBeCombinedWith("A")]
public bool B { get; set; }
[ArgCantBeCombinedWith("D")]
public bool C { get; set; }
[ArgCantBeCombinedWith("C")]
public bool D { get; set; }
}

if you read through the reply provided by the creator of this project you should be able to accomplish most of what you are looking for with that feature out of the box.

Hope this helps

from powerargs.

adamabdelhamed avatar adamabdelhamed commented on September 4, 2024

@PCkris, thanks for writing that up. You're exactly right. @jehrenzweig, what you're asking for has been done, for example in PowerShell, but I think it's difficult for users to understand sets of required parameters (called parameter sets in PowerShell), but it's easy to understand that a particular argument can or can't be combined with another.

If you read through #47 then you'll also see that there's the if and ifnot enhancements that have been added to [ArgRequired] that give you all the flexibility you should need.

from powerargs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.