Comments (4)
Hey, thanks for this interesting observation. It might be possible.
Right now commandeer
relies on parseopt2
to do the initial command line parsing. Great, we don't have to worry about extracting the command line arguments ourself AND developers (and by consequence users) already familiar with parseopt2
's behaviour know what to expect and can port their manual usage of parseopt2
over to commandeer
! If we are to achieve space separated options, we would have to add a layer of accounting on parseopt2
to keep track of argument/option order. It is something I have thought a bit about but would need to investigate more.
I am going to keep this open like #5 because they are along the same lines even though I don't have anything in the short term yet.
from commandeer.
developers (and by consequence users) already familiar with parseopt2's behaviour know what to expect
The problem is that people are familiar with CLIs, not the tools to build CLIs :-) And it's quite common to separate options and their values with a space.
Maybe the right thing to do is to add this feature to parseopt2. What do you think?
from commandeer.
add this feature to parseopt2
That would be an interesting thing to do! Getting consensus on a larger user base like parseopt2 / the nim ecosystem may be harder though ;)
from commandeer.
Hello! I just merged #16 that addresses this:
commandline:
argument path, string
option target, char, "target", "t"
# called with myapp -t t path
echo "path ", path # path
echo "target ", target # t
I didn't go the parseopt2 avenue for the stated reasons and also because I suspect parseopt2's current implementation makes it more flexible for another library to work a top of.
In any case I am closing this. Cheers!
from commandeer.
Related Issues (11)
- Support for default values HOT 3
- Aliases for subcommands HOT 2
- Commandeer doesn't compile on 0.14.3 (devel branch) of compiler HOT 1
- Setting arguments(..., ..., atleast1=false) still expects at least one argument HOT 2
- Automatically generate --help HOT 2
- Can't pass in an empty string to an option HOT 2
- Can't have the same options specified for multiple subcommands HOT 2
- proposal: seq types for repeated options HOT 6
- update from 0.9.1 to 0.10.2 fails HOT 2
- Throw error if subcommand is missing HOT 2
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.
from commandeer.