]> xn--ix-yja.es Git - alex.git/commitdiff
Explain the main argparse limitation
authorAlex Corcoles <alex@pdp7.net>
Fri, 28 Oct 2022 09:29:26 +0000 (11:29 +0200)
committerGitHub <noreply@github.com>
Fri, 28 Oct 2022 09:29:26 +0000 (11:29 +0200)
programming/python/creating_nice_python_cli_tools.md

index e0071b2a144c0f6f4e0b57ea6ea5c8b1a2aa2174..f878c757998e866917244dab3337710b37ba5f69 100644 (file)
@@ -26,6 +26,7 @@ Following this advice can make your tools easy to install by others, pleasant to
   * Consider using the standard [logging](https://docs.python.org/3/library/logging.html) module with a format that uses a timestamp, so users can inspect how much time is spent in different parts of the program.
     You can also use logging module to implement flags such as `--debug` and `--verbose`.
 * Although fancier tools exist, the standard [argparse](https://docs.python.org/3/library/argparse.html) module is good enough for most argument parsing.
+  The main functionality missing is easy tab completion.
   It has decent support for [sub-commands](https://docs.python.org/3/library/argparse.html#sub-commands), and the linked document describes a very nice pattern to define functions for sub-commands, under "One particularly effective way of handling sub-commands..."
   Provide help text for non-obvious parameters.
   argparse supports a lot of different argument types with a lot of functionality out of the box, such as enumerated options, integers, and file names.