generator
generator copied to clipboard
An MVP CLI for urlshortener V1
This includes a handmade prototype with the following capabilities
- [x] make prototype that compiles
- [x] refactor into a state that is better than before
- [ ] use a public method
- [ ] figure out a way to differentiate api-key, oaut2 token, and installed application flows
- [ ] be able to login
- [ ] use a private method successfully (like the summary)
For the prototype code generation
- [ ] generate an MVP of the CLI above with syn/quote
- [ ] a way to generate CLI documentation
As a basic requirement: the CLI should be at least as powerful as the ones in OP, and on a similar level of quality.
This is the current epic, there will be many related tasks.
Unanswered questions
- how debugging should be facilitated. We don't support the 'TeeConnector' for spying on all http traffic anymore.
Quick POC to assert we can now construct the whole clap App on the heap right away, which allows to drop the ugly workaround previously employed:
//# default-boxed = "*"
use default_boxed::DefaultBoxed;
use clap;
// #[derive(DefaultBoxed)]
struct Foo<'a, 'b> {
e: clap::App<'a, 'b>
}
impl<'a, 'b> Default for Foo<'a, 'b> {
fn default() -> Foo<'a, 'b> {
Foo {
e: clap::App::new("foo"),
}
}
}
fn main() {
// std::mem::drop(Foo::default());
let foo = Foo::default_boxed();
foo.e.get_matches();
}