actix-swagger icon indicating copy to clipboard operation
actix-swagger copied to clipboard

Parsing arguments fails

Open RReverser opened this issue 3 years ago • 3 comments

I'm trying to use it as per docs, but getting error at the stage of parsing arguments:

> cargo swagg ./AlpacaDeviceAPI_v1.yaml --out-file src/api.rs
error: Found argument './AlpacaDeviceAPI_v1.yaml' which wasn't expected, or isn't valid in this context

USAGE:
    cargo-swagg.exe [OPTIONS] <source>

For more information try --help

Am I missing something?

RReverser avatar Sep 28 '22 13:09 RReverser

I get this as well. How is the command supposed to be run?

hjizettle avatar Nov 17 '22 08:11 hjizettle

I've run into the same thing (on Windows). It looks like running as cargo swag ./api.yaml --out-file ./src/api.rs is interpreted as swag being the source path. If I run it as cargo-swag.exe ./api.yaml --out-file ./src/api.rs then the program runs correctly. Hopefully this workaround helps!

FlipWarthog avatar Dec 04 '22 17:12 FlipWarthog

@FlipWarthog Ohhh thanks. I've moved on and wrote my own generator for the specific usecase I had, but this would've been helpful before 😅

RReverser avatar Dec 04 '22 18:12 RReverser