Comments (4)
An option based on #24
name: myapp
version: "1.0"
author: Kevin K. <[email protected]>
about: Does awesome things
args:
- name: config
short: c
long: config
value_name: FILE
help: Sets a custom config file
takes_value: true
- name: INPUT
help: Sets the input file to use
required: true
index: 1
- app:
help_heading: DEBUG
- name: verbose
short: v
multiple: true
help: Sets the level of verbosity
subcommands:
- test:
about: controls testing features
version: "1.3"
author: Someone E. <[email protected]>
args:
- debug:
short: d
help: print debug information
In effect, the data model for args
is
struct App {
...
args: Vec<ArgEntry>,
}
#[serde(untagged)]
enum ArgEntry {
App(AppArg),
Arg(Arg),
}
struct AppArg {
app: AppArg2
}
struct AppArg2 {
help_heading: Option<String>
}
(Ok, I got less creative with names as I went)
from clap-serde.
Is this clap-rs/clap#3002?
from clap-serde.
What is the difference between AppArg
and Arg
?
from clap-serde.
Parts are in clap-rs/clap#3002 and in other issues.
AppArg
exists for forcing the app
key to be present since ArgEntry
needs to be untagged.
from clap-serde.
Related Issues (20)
- Documenet data model
- Serialize support
- Auto generate docs by serializing App and Arg.
- Use arrays for ordered items HOT 4
- Update to 3.1
- Add more tests HOT 1
- Make it possible to override argument parameter.
- Env support?
- OsStr support? HOT 1
- Support clap 3.2 HOT 2
- use serde-yaml 0.9
- Provide a way to load directly into a clap app HOT 3
- clap 4 support HOT 1
- Should 'required = false' in arg. allow default value to be undefined? HOT 4
- feat: export ENV vars command line clap2env tool HOT 4
- Deref wrappers to inner type?
- Only expose the Settings you have to HOT 5
- More idiomatic setting names
- Global settins support?
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 clap-serde.