-
Notifications
You must be signed in to change notification settings - Fork 9
Needs option to run against all files #26
Comments
I absolutely agree that we should support running doctest over multiple arguments in a single invocation. What I've been struggling with for this and I can think of a few options:
The problem is, like most CLI matters, is that you can find examples of all of these, but often none of them are convincingly better than any alternatives. I want |
@mattt just my opinion, but I'd make the case that solutions that require using (or piping from) other tools create a barrier to entry for beginners. Instead of being able to quickly use a new tool, the user need to learn two commands. In practice the Personally I really like the
Going further, I'd argue that the unix-y philosophy of do one thing well and compose with other tools, is much more important for very generalised tools like Specialised tools should probably prioritise user ergonomics over strict composability. |
@iainsmith Thanks for sharing your thoughts. I think that's a really helpful way to think about things! On the command line, there's a spectrum from generalized utilities to applications, and where an executable finds itself on that largely determines the right balance of composability and ergonomics. The thing I struggle with is that ergonomics seem to be subjective, and often turn into a slippery slope of affordances. For example, I agree with the behavior of Do you change the behavior to say "ignore hidden directories"? If so, do you add a flag to explicitly include certain directories? Pretty soon, you've reinvented globbing. Rather than close the skill gap by eliminating |
Very nicely put.
I think this is a good example where we can follow the "rule of least astonishment". I would expect running
I feel like there is a false dichotomy between "ergonomics" and "closing the skill gap" in the last sentence, as it seems like we can have both. Having a "Composition" section in the README or detailed in the Giving people short intuitive commands like
I totally agree this is all subjective. Personally I tend to lean towards tools providing memorable, "easy to type" commands for common use cases, but as long as there is documentation on how to get things done, people can build aliases and wrappers to get the UX they want 👍. |
I'd love to be able to just
swift doctest .
and have it run recursively on all swift files under my CWD.The text was updated successfully, but these errors were encountered: