Dear rust devs on twitter, is there a better way to do this? This seems... verbose lol. But still better than what most of my CLIs with subcommands look like :P https://github.com/yoshuawuyts/playground-structopt/blob/master/src/main.rs#L35-L69 …
-
-
Replying to @yoshuawuyts
you can replace the `let opts = …` dance you do for printing with `opts @ …` in front of the pattern IIRC (and also write the pattern on one line but rustfmt might disagree)
2 replies 0 retweets 1 like -
Replying to @killercup @yoshuawuyts
Oh and you can use doc comments (`/// foo`) instead of `about = "foo"`!
1 reply 0 retweets 1 like -
Replying to @killercup
Ohh, the comments thing is super neat! That definitely makes things easier :D I'm having trouble reading up on the @ symbol tho; is there a keyword I could look for so I can read up on it further? Compiler doesn't help with trial / error programming here, haha :P
1 reply 0 retweets 0 likes -
Replying to @yoshuawuyts
Hmm this is more of a niche feature than expected. The reference has a single example: https://doc.rust-lang.org/reference/expressions/match-expr.html …
2 replies 0 retweets 1 like
Heh, so we ended up with "it'd be neat to use the configure crate to minimize the API surface inside the bin code" But the configure crate doesn't support exposing flags for subcommands yet. Ghmmmm, it'd be super nice if it did!
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.