Giter VIP home page Giter VIP logo

dopt's People

Contributors

tarkah avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

dopt's Issues

Weird compilation error

Consider this repository and this commit: serpent-os/boulder-d-legacy@d72bb75

If you build it with dub build boulder:container, you'll see

../../../.dub/packages/dopt/c90d16a/dopt/source/dopt/parse.d(336,34): Error: none of the overloads of template dopt.parse.subcommand are callable using argument types !()(ContainerCLI)
../../../.dub/packages/dopt/c90d16a/dopt/source/dopt/parse.d(311,28): Candidate is: subcommand(T)(ref T t, ref string[] args, string[] path)
../../../.dub/packages/dopt/c90d16a/dopt/source/dopt/parse.d(105,24): Error: template instance dopt.parse.subcommand!(ContainerCLI) error instantiating
../../../.dub/packages/dopt/c90d16a/dopt/source/dopt/parse.d(62,19): instantiated from here: parseArgs!(ContainerCLI)
source/container/cli/package.d(45,15): instantiated from here: parse!(ContainerCLI)

But if you apply this patch:

diff --git a/source/container/cli/package.d b/source/container/cli/package.d
index 4e079f0..3235cea 100644
--- a/source/container/cli/package.d
+++ b/source/container/cli/package.d
@@ -34,7 +34,7 @@ public struct ContainerCLI
     string path = null;
 
     @Subcommand()
-    Subcommands commands;
+    Subcommands subcommand;


 }

It builds! Do fields have to be prefixed by their type name?

Push dopt to the DUB registry

For convenience, dopt should be pushed to the DUB registry. Do note though there already is a namesake package, so we'll either need some prefix/suffix, or to rename the library entirely.

This issue is especially important when using Meson to compile a project, since I wasn't able to find a straightforward way of downloading a library with dub by providing a URL. Since Meson can only look for local dub packages, I must manually dub fetch and dub build dopt first, but it's apparently impossible if dopt is not listed in the registry.

How to escape flags?

Suppose I have:

@Command() @Help("Run a command in an existing container")
package struct Run {
    @Positional() @Help("Command to run, with arguments")
    string[] args;
}

I want to pass ./mycommand run /bin/bash --login. Currently I get in return Unrecognized option --login.

How can I tell dopt the --login flag is part of the args array? ./mycommand run -- /bin/bash --login doesn't work either.

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.