Git Product home page Git Product logo

Comments (5)

nemec avatar nemec commented on September 14, 2024

What is the full text you are sending to the application? I suspect what you are trying to do is not supported - only one verb may be used at a time. The first verb you use is probably trying to read the second verb as if it were a parameter of its own.

from commandline.

dmikov avatar dmikov commented on September 14, 2024

I am sure this is the issue, does it not tokenize verbs on it's own? So now only one verb can be used? You cannot decide to mydatabaseutil clean -all upgrade -v:3 validate -strict?

from commandline.

nemec avatar nemec commented on September 14, 2024

No it does not. The library allows "free" argument values (identified by a ValueAttribute) that are not tied to a flag like -v. For example, a verb like:

class CreateProject
{
    [Value]
    public string ProjectName { get; set; }
}

when called with util.exe createproject upgrade would be parsed as verb=CreateProject, ProjectName=upgrade. Even if you had a second verb called Upgrade, the parser would continue parsing as if the remaining arguments belonged to properties on the initial verb.

I hope that makes sense.

from commandline.

dmikov avatar dmikov commented on September 14, 2024

Of course it does. I am just accustomed to tokenizing in Python cli etc. I can see how tokenizing to verbs|options/arguments during runtime, make it hard to do precise verb names instead. I will try to write good parser with antlr that can do a list of verbs to do the right AST. Hopefully we can use it here, I really not looking forward to reinvent all attributes that is so nicely implemented here.

from commandline.

nemec avatar nemec commented on September 14, 2024

What python library are you using to get that feature? I really only have experience with argparse..

from commandline.

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.