dopt's People
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 instancedopt.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.
Exceptions should probably inherit from a common ancestor
Instead of catching multiple exceptions, and for example return 0 for each of them, it's handier to have a common DoptException ancestor. This way, we can catch only it and save a few lines.
`@Positional()` arguments are always mandatory
@Positional()
arguments are always mandatory even without @Required()
.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.