Merge pull request #63 from julen/doc-fixes
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Armin Ronacher · committed by Armin Ronacher · parents 5d85db9, 2a2c4f4 · Browse files · 3 files·+8 added−8 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Trailers
- Docs: fixes
Diff stats
3 files+8 added−8 removed
- other:+8 added−8 removed
Provenance
- Commit
0868754- Tree
69f97a4- Author
Armin Ronacher <armin.ronacher@active-4.com>- Committer
Armin Ronacher <armin.ronacher@active-4.com>- Parent 1
5d85db9- Parent 2
2a2c4f4
3 files changed+8 added−8 removed
modified:click/formatting.py+1 added-1 removed
201 unmodified lines202 def section(self, name):203 """Helpful context manager that writes a paragraph, a heading204 and the indents.205 206- :param name: the section name taht is written as heading.206+ :param name: the section name that is written as heading.207 """208 self.write_paragraph()209 self.write_heading(name)210 self.indent()17 unmodified linesmodified:docs/complex.rst+3 added-3 removed
10 unmodified lines11 realized that it provides a command line utility. But so does Celery for12 instance. So when using Celery with Django there are two tools that need13 to interact with each other and be cross configured.14 15-In a theoretical world of two separate Click command line utilities they15+In a theoretical world of two separate click command line utilities they16 can solve this problem by nesting one inside the other. For instance the17 web framework could also load the commands for the message queue18 framework.19 5 unmodified lines25 26 Contexts27 ````````28 29-Whenever a Click command is executed a :class:`Context` object is created29+Whenever a click command is executed a :class:`Context` object is created30 which holds state for this particular invocation. For instance it31 remembers parsed parameters, what command created it, which resources need32 to be cleaned up at the end of the function and so forth. It also holds33 an application defined object optionally.11 unmodified lines45 46 Calling Convention47 ``````````````````48 49-When a Click command callback is executed it's passed all the non hidden49+When a click command callback is executed it's passed all the non hidden50 parameters as keyword arguments. Notably absent is the context. However51 a callback can opt-into being passed the context object by marking itself52 with :func:`pass_context`.53 166 unmodified linesmodified:docs/why.rst+4 added-4 removed
69 unmodified lines70 Python library that tries to aim for composability of applications that71 goes beyond what the system itself supports.72 73 Docopt for instance acts by parsing your help pages and then parsing74-according do those rules. The side effect of this is that docopt is quite74+according to those rules. The side effect of this is that docopt is quite75 rigid in how it handles the command line interface. The upside of docopt76 is that it gives you strong control over your help page, the downside is77 that due to that it cannot rewrap your output for the current terminal78 width and it makes translations hard. On top of that docopt is restricted5 unmodified lines84 support dispatching to subcommands, it for instance does not directly85 support any kind of automatic subcommand enumeration based on what's86 available or it does not enforce subcommands to work in a consistent way.87 88-This is fine, but it's different from how Click wants to work. Click aims88+This is fine, but it's different from how click wants to work. Click aims89 to support fully composable command line user interfaces by doing this:90 91-- click does not just parse, it also dispatches to the appropriate code91+- click does not just parse, it also dispatches to the appropriate code.92 - click has a strong concept of an invocation context that allows93 subcommands to respond to data from the parent command.94 - click has strong information available for all parameters and commands95 so that it can generate unified help pages for the full CLI and to1 unmodified line97 - click has strong understanding of what types are and can give the user98 consistent error messages if something goes wrong. A subcommand99 written by a different developer will not suddenly die with a100 different error messsage because it's manually handled.101-- click has enough meta information available for it's whole program101+- click has enough meta information available for its whole program102 that it can evolve over time to improve the user experience without103 forcing developers to adjust their programs. For instance if click104 decides to change how help pages are formatted, all click programs105 will automatically benefit from this.27 unmodified lines