Assumes ``$_ARGCOMPLETE`` is set and `argcomplete` is importable Increment the index pointed to by ``$_ARGCOMPLETE``, which is used to determine which word `argcomplete` should start evaluating the command-line. This may be useful to "inform" `argcomplete` that we have already evaluated
()
| 62 | |
| 63 | |
| 64 | def increment_argcomplete_index() -> None: |
| 65 | """Assumes ``$_ARGCOMPLETE`` is set and `argcomplete` is importable |
| 66 | |
| 67 | Increment the index pointed to by ``$_ARGCOMPLETE``, which is used to |
| 68 | determine which word `argcomplete` should start evaluating the command-line. |
| 69 | This may be useful to "inform" `argcomplete` that we have already evaluated |
| 70 | the first word as a subcommand. |
| 71 | """ |
| 72 | try: |
| 73 | os.environ["_ARGCOMPLETE"] = str(int(os.environ["_ARGCOMPLETE"]) + 1) |
| 74 | except Exception: |
| 75 | try: |
| 76 | argcomplete.debug("Unable to increment $_ARGCOMPLETE", os.environ["_ARGCOMPLETE"]) # type:ignore[attr-defined,no-untyped-call] |
| 77 | except (KeyError, ModuleNotFoundError): |
| 78 | pass |
| 79 | |
| 80 | |
| 81 | class ExtendedCompletionFinder(CompletionFinder): |
no outgoing calls
no test coverage detected
searching dependent graphs…