Previously we only knew the type as string, now we have enums and
additional type information, like whether or not it's a POD.
However, borrow-checker doesn't like the current code, will need more
work.
Instead of using multiple lines to add vectors up involving iterators,
I just add slices together. This should produce less, and possibly
faster machine code, with less ascii code.
Downloads tested with drive2, and are verified to be working !
Close#97
* functionality is cursor-aware, and fixes the actual string the user
passed in. That way, it is made very clear how the suggested value
is to be used.
* it's a known weakness of the implementation that it operates on a
flattened list of field names, and thus may make nonsensical
suggestions.
* added punctuation to all errors
Fixes#67
[skip ci]
* adjust documentation to resemble actual upload flag semantics. It was
still using the one previously used in docopt.
* Make -m <mime-type> optional, defaulting to 'application/octet-stream'
Should have been fixed alongside of #81
* mkdoc docs grammar is now hierarchical, making the command structure
more obvious and easier to understand. It's a nice addition to the
auto-generated, hierachical usage of clap.
* UploadProtocol enum is now CallType, to ease handling the different
ways the Call has to be executed. It looks quite clean, even though
combining upload protocols and the calltype is a bit hacky.
* `--version` now includes the API revision we embody
(using crate_version())
* Allow multiple scopes to be specified, instead of just one. Previously
this was problemantic due to argument parsing of docopt being greedy.
However, this also means we have to specify the `-r` flag for each
invocation. See https://github.com/kbknapp/clap-rs/issues/89 .
* Adapted to new signature of `Arg::possible_values()` and used the
previously orphaned `UploadProtocol` enum.
* Deduplicated code a little by adding the new `opt_values()` generator
function.
Related to #81
We are currently setting everything up at runtime, and manage to get
nearly all information into it, except for the more complex
`-u (simple|resumable) <file> <mime>` flag.
Fixes#87
Related to #81
* Seem to work for docopt, mkdocs and code itself
* mkdocs now show type of required params
* some code which deals with converting elements to their
target types is totally untested right now.
Related to #77
* Default::default() optimized to use T::default() if possible
* deduplicated special type handling ('Count' strings -> int64)
* put request value parsing into own private function
Fixes#69
[skip ci]
This works already for simple request values, but doens't generate
compiling code for structures with Parts in them.
Nonetheless, it's a big step towards finishing the overall issue.
Related to #64
We are parsing required scalar values and handle parse-errors correctly,
to the point were we make a simple, non-upload doit() call.
It shows that we seem to build invalid calls, for now,but that's nothing
we can't fix once the time is ripe.
Next goals will be related to finalizing the argument parsing code.
Fixes#60
Now we are able to cleanly handle our arguments on a per-method basis.
The generated code won't clutter our design as we put the details into
their own methods.
Fixes#59
* Instead of writing pod-types, we generate a random value of the
required type.
* Fully document how cursors can be set, which is all that's usually
demonstrated in more complex dynamic structure documentation
Fixes#49
We build all required -r flags using absolute cursor positions only.
The next step should be to use relative ones, and of course be more
verbose about how this should be interpreted (sequential).
* in APIs, scopes will now be per-method, and if no scope is given,
we will assume only the API key has to be set. Previously there was
a wild mix between globally mentioned scopes and method scopes.
* assure CLI generation works so far, for all avaialable APIs
Related to #48
For now we just have a 'dum' example, but once we are there, we shall
make the example and documentation based on the actual request value.
This requires some additional work, which fortunately has to be done
in python only.
Grammar is laid out per method, providing general purpose arguments
only as needed/supported.
All details will be contained in the markdown documentation.
Related to #45
Previously we put cli.py into the common lib folder, which caused the
API to be regenerated and rebuilt whenever we changed code that will
only affect the CLI, causing terrible turnaround times.
Now the dependency is fixed.