Open joshuawprice opened 2 years ago
Also, check length is an option for determining if it as an API (they are 64 chars long). Also maybe parsing it as base 16 or something.
So it turns out optionally consuming arguments is not possible with argparse (at least not without using internal apis). Instead, how about spitting out files from the init function in asgard/catgirls types?
If this doesn't work then I'll leave it alone as I don't think exactly what I want is possible.
At the moment the parser leaves a lot to be desired with regards to consuming arguments, a few examples of which are:
./
.), and stop consuming on--
like it does already.As for implementing this I believe some of the nargs parameters will need to be removed from the add_arguments calls and the current actions to be modified. This idea came from this note in the argparse documentation:
The above way is much better than the original way I thought, but I shall paste some bullet points below of my original notes in case the above fails:
I also think SingleAppendAction's name should be changed to something like UniqueAppendAction or UploadAction. And lastly I think I should improve the init method in SingleAppendConstAction by using **kwargs (see argparse documentation action and Action classes