Primer commit
This commit is contained in:
@@ -0,0 +1 @@
|
||||
pip
|
||||
@@ -0,0 +1,177 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
@@ -0,0 +1,351 @@
|
||||
Metadata-Version: 2.1
|
||||
Name: argcomplete
|
||||
Version: 3.2.2
|
||||
Summary: Bash tab completion for argparse
|
||||
Home-page: https://github.com/kislyuk/argcomplete
|
||||
Author: Andrey Kislyuk
|
||||
Author-email: kislyuk@gmail.com
|
||||
License: Apache Software License
|
||||
Project-URL: Documentation, https://kislyuk.github.io/argcomplete
|
||||
Project-URL: Source Code, https://github.com/kislyuk/argcomplete
|
||||
Project-URL: Issue Tracker, https://github.com/kislyuk/argcomplete/issues
|
||||
Project-URL: Change Log, https://github.com/kislyuk/argcomplete/blob/master/Changes.rst
|
||||
Platform: MacOS X
|
||||
Platform: Posix
|
||||
Classifier: Environment :: Console
|
||||
Classifier: Intended Audience :: Developers
|
||||
Classifier: License :: OSI Approved :: Apache Software License
|
||||
Classifier: Operating System :: MacOS :: MacOS X
|
||||
Classifier: Operating System :: POSIX
|
||||
Classifier: Programming Language :: Python
|
||||
Classifier: Programming Language :: Python :: 3
|
||||
Classifier: Programming Language :: Python :: 3.7
|
||||
Classifier: Programming Language :: Python :: 3.8
|
||||
Classifier: Programming Language :: Python :: 3.9
|
||||
Classifier: Programming Language :: Python :: 3.10
|
||||
Classifier: Programming Language :: Python :: 3.11
|
||||
Classifier: Programming Language :: Python :: 3.12
|
||||
Classifier: Programming Language :: Python :: Implementation :: CPython
|
||||
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
||||
Classifier: Development Status :: 5 - Production/Stable
|
||||
Classifier: Topic :: Software Development
|
||||
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
||||
Classifier: Topic :: System :: Shells
|
||||
Classifier: Topic :: Terminals
|
||||
Requires-Python: >=3.8
|
||||
Description-Content-Type: text/x-rst
|
||||
License-File: LICENSE.rst
|
||||
License-File: NOTICE
|
||||
Provides-Extra: test
|
||||
Requires-Dist: coverage ; extra == 'test'
|
||||
Requires-Dist: pexpect ; extra == 'test'
|
||||
Requires-Dist: wheel ; extra == 'test'
|
||||
Requires-Dist: ruff ; extra == 'test'
|
||||
Requires-Dist: mypy ; extra == 'test'
|
||||
|
||||
argcomplete - Bash/zsh tab completion for argparse
|
||||
==================================================
|
||||
*Tab complete all the things!*
|
||||
|
||||
Argcomplete provides easy, extensible command line tab completion of arguments for your Python application.
|
||||
|
||||
It makes two assumptions:
|
||||
|
||||
* You're using bash or zsh as your shell
|
||||
* You're using `argparse <http://docs.python.org/3/library/argparse.html>`_ to manage your command line arguments/options
|
||||
|
||||
Argcomplete is particularly useful if your program has lots of options or subparsers, and if your program can
|
||||
dynamically suggest completions for your argument/option values (for example, if the user is browsing resources over
|
||||
the network).
|
||||
|
||||
Installation
|
||||
------------
|
||||
::
|
||||
|
||||
pip install argcomplete
|
||||
activate-global-python-argcomplete
|
||||
|
||||
See `Activating global completion`_ below for details about the second step.
|
||||
|
||||
Refresh your shell environment (start a new shell).
|
||||
|
||||
Synopsis
|
||||
--------
|
||||
Add the ``PYTHON_ARGCOMPLETE_OK`` marker and a call to ``argcomplete.autocomplete()`` to your Python application as
|
||||
follows:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
#!/usr/bin/env python
|
||||
# PYTHON_ARGCOMPLETE_OK
|
||||
import argcomplete, argparse
|
||||
parser = argparse.ArgumentParser()
|
||||
...
|
||||
argcomplete.autocomplete(parser)
|
||||
args = parser.parse_args()
|
||||
...
|
||||
|
||||
Register your Python application with your shell's completion framework by running ``register-python-argcomplete``::
|
||||
|
||||
eval "$(register-python-argcomplete my-python-app)"
|
||||
|
||||
Quotes are significant; the registration will fail without them. See `Global completion`_ below for a way to enable
|
||||
argcomplete generally without registering each application individually.
|
||||
|
||||
argcomplete.autocomplete(*parser*)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
This method is the entry point to the module. It must be called **after** ArgumentParser construction is complete, but
|
||||
**before** the ``ArgumentParser.parse_args()`` method is called. The method looks for an environment variable that the
|
||||
completion hook shellcode sets, and if it's there, collects completions, prints them to the output stream (fd 8 by
|
||||
default), and exits. Otherwise, it returns to the caller immediately.
|
||||
|
||||
.. admonition:: Side effects
|
||||
|
||||
Argcomplete gets completions by running your program. It intercepts the execution flow at the moment
|
||||
``argcomplete.autocomplete()`` is called. After sending completions, it exits using ``exit_method`` (``os._exit``
|
||||
by default). This means if your program has any side effects that happen before ``argcomplete`` is called, those
|
||||
side effects will happen every time the user presses ``<TAB>`` (although anything your program prints to stdout or
|
||||
stderr will be suppressed). For this reason it's best to construct the argument parser and call
|
||||
``argcomplete.autocomplete()`` as early as possible in your execution flow.
|
||||
|
||||
.. admonition:: Performance
|
||||
|
||||
If the program takes a long time to get to the point where ``argcomplete.autocomplete()`` is called, the tab completion
|
||||
process will feel sluggish, and the user may lose confidence in it. So it's also important to minimize the startup time
|
||||
of the program up to that point (for example, by deferring initialization or importing of large modules until after
|
||||
parsing options).
|
||||
|
||||
Specifying completers
|
||||
---------------------
|
||||
You can specify custom completion functions for your options and arguments. Two styles are supported: callable and
|
||||
readline-style. Callable completers are simpler. They are called with the following keyword arguments:
|
||||
|
||||
* ``prefix``: The prefix text of the last word before the cursor on the command line.
|
||||
For dynamic completers, this can be used to reduce the work required to generate possible completions.
|
||||
* ``action``: The ``argparse.Action`` instance that this completer was called for.
|
||||
* ``parser``: The ``argparse.ArgumentParser`` instance that the action was taken by.
|
||||
* ``parsed_args``: The result of argument parsing so far (the ``argparse.Namespace`` args object normally returned by
|
||||
``ArgumentParser.parse_args()``).
|
||||
|
||||
Completers can return their completions as an iterable of strings or a mapping (dict) of strings to their
|
||||
descriptions (zsh will display the descriptions as context help alongside completions). An example completer for names
|
||||
of environment variables might look like this:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
def EnvironCompleter(**kwargs):
|
||||
return os.environ
|
||||
|
||||
To specify a completer for an argument or option, set the ``completer`` attribute of its associated action. An easy
|
||||
way to do this at definition time is:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from argcomplete.completers import EnvironCompleter
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--env-var1").completer = EnvironCompleter
|
||||
parser.add_argument("--env-var2").completer = EnvironCompleter
|
||||
argcomplete.autocomplete(parser)
|
||||
|
||||
If you specify the ``choices`` keyword for an argparse option or argument (and don't specify a completer), it will be
|
||||
used for completions.
|
||||
|
||||
A completer that is initialized with a set of all possible choices of values for its action might look like this:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
class ChoicesCompleter(object):
|
||||
def __init__(self, choices):
|
||||
self.choices = choices
|
||||
|
||||
def __call__(self, **kwargs):
|
||||
return self.choices
|
||||
|
||||
The following two ways to specify a static set of choices are equivalent for completion purposes:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from argcomplete.completers import ChoicesCompleter
|
||||
|
||||
parser.add_argument("--protocol", choices=('http', 'https', 'ssh', 'rsync', 'wss'))
|
||||
parser.add_argument("--proto").completer=ChoicesCompleter(('http', 'https', 'ssh', 'rsync', 'wss'))
|
||||
|
||||
Note that if you use the ``choices=<completions>`` option, argparse will show
|
||||
all these choices in the ``--help`` output by default. To prevent this, set
|
||||
``metavar`` (like ``parser.add_argument("--protocol", metavar="PROTOCOL",
|
||||
choices=('http', 'https', 'ssh', 'rsync', 'wss'))``).
|
||||
|
||||
The following `script <https://raw.github.com/kislyuk/argcomplete/master/docs/examples/describe_github_user.py>`_ uses
|
||||
``parsed_args`` and `Requests <http://python-requests.org/>`_ to query GitHub for publicly known members of an
|
||||
organization and complete their names, then prints the member description:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
#!/usr/bin/env python
|
||||
# PYTHON_ARGCOMPLETE_OK
|
||||
import argcomplete, argparse, requests, pprint
|
||||
|
||||
def github_org_members(prefix, parsed_args, **kwargs):
|
||||
resource = "https://api.github.com/orgs/{org}/members".format(org=parsed_args.organization)
|
||||
return (member['login'] for member in requests.get(resource).json() if member['login'].startswith(prefix))
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--organization", help="GitHub organization")
|
||||
parser.add_argument("--member", help="GitHub member").completer = github_org_members
|
||||
|
||||
argcomplete.autocomplete(parser)
|
||||
args = parser.parse_args()
|
||||
|
||||
pprint.pprint(requests.get("https://api.github.com/users/{m}".format(m=args.member)).json())
|
||||
|
||||
`Try it <https://raw.github.com/kislyuk/argcomplete/master/docs/examples/describe_github_user.py>`_ like this::
|
||||
|
||||
./describe_github_user.py --organization heroku --member <TAB>
|
||||
|
||||
If you have a useful completer to add to the `completer library
|
||||
<https://github.com/kislyuk/argcomplete/blob/master/argcomplete/completers.py>`_, send a pull request!
|
||||
|
||||
Readline-style completers
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
The readline_ module defines a completer protocol in rlcompleter_. Readline-style completers are also supported by
|
||||
argcomplete, so you can use the same completer object both in an interactive readline-powered shell and on the command
|
||||
line. For example, you can use the readline-style completer provided by IPython_ to get introspective completions like
|
||||
you would get in the IPython shell:
|
||||
|
||||
.. _readline: http://docs.python.org/3/library/readline.html
|
||||
.. _rlcompleter: http://docs.python.org/3/library/rlcompleter.html#completer-objects
|
||||
.. _IPython: http://ipython.org/
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
import IPython
|
||||
parser.add_argument("--python-name").completer = IPython.core.completer.Completer()
|
||||
|
||||
``argcomplete.CompletionFinder.rl_complete`` can also be used to plug in an argparse parser as a readline completer.
|
||||
|
||||
Printing warnings in completers
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Normal stdout/stderr output is suspended when argcomplete runs. Sometimes, though, when the user presses ``<TAB>``, it's
|
||||
appropriate to print information about why completions generation failed. To do this, use ``warn``:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from argcomplete import warn
|
||||
|
||||
def AwesomeWebServiceCompleter(prefix, **kwargs):
|
||||
if login_failed:
|
||||
warn("Please log in to Awesome Web Service to use autocompletion")
|
||||
return completions
|
||||
|
||||
Using a custom completion validator
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
By default, argcomplete validates your completions by checking if they start with the prefix given to the completer. You
|
||||
can override this validation check by supplying the ``validator`` keyword to ``argcomplete.autocomplete()``:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
def my_validator(completion_candidate, current_input):
|
||||
"""Complete non-prefix substring matches."""
|
||||
return current_input in completion_candidate
|
||||
|
||||
argcomplete.autocomplete(parser, validator=my_validator)
|
||||
|
||||
Global completion
|
||||
-----------------
|
||||
In global completion mode, you don't have to register each argcomplete-capable executable separately. Instead, the shell
|
||||
will look for the string **PYTHON_ARGCOMPLETE_OK** in the first 1024 bytes of any executable that it's running
|
||||
completion for, and if it's found, follow the rest of the argcomplete protocol as described above.
|
||||
|
||||
Additionally, completion is activated for scripts run as ``python <script>`` and ``python -m <module>``. If you're using
|
||||
multiple Python versions on the same system, the version being used to run the script must have argcomplete installed.
|
||||
|
||||
.. admonition:: Bash version compatibility
|
||||
|
||||
When using bash, global completion requires bash support for ``complete -D``, which was introduced in bash 4.2. Since
|
||||
Mac OS ships with an outdated version of Bash (3.2), you can either use zsh or install a newer version of bash using
|
||||
`Homebrew <http://brew.sh/>`_ (``brew install bash`` - you will also need to add ``/opt/homebrew/bin/bash`` to
|
||||
``/etc/shells``, and run ``chsh`` to change your shell). You can check the version of the running copy of bash with
|
||||
``echo $BASH_VERSION``.
|
||||
|
||||
.. note:: If you use setuptools/distribute ``scripts`` or ``entry_points`` directives to package your module,
|
||||
argcomplete will follow the wrapper scripts to their destination and look for ``PYTHON_ARGCOMPLETE_OK`` in the
|
||||
destination code.
|
||||
|
||||
If you choose not to use global completion, or ship a completion module that depends on argcomplete, you must register
|
||||
your script explicitly using ``eval "$(register-python-argcomplete my-python-app)"``. Standard completion module
|
||||
registration rules apply: namely, the script name is passed directly to ``complete``, meaning it is only tab completed
|
||||
when invoked exactly as it was registered. In the above example, ``my-python-app`` must be on the path, and the user
|
||||
must be attempting to complete it by that name. The above line alone would **not** allow you to complete
|
||||
``./my-python-app``, or ``/path/to/my-python-app``.
|
||||
|
||||
Activating global completion
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
The script ``activate-global-python-argcomplete`` installs the global completion script
|
||||
`bash_completion.d/_python-argcomplete <https://github.com/kislyuk/argcomplete/blob/master/argcomplete/bash_completion.d/_python-argcomplete>`_
|
||||
into an appropriate location on your system for both bash and zsh. The specific location depends on your platform and
|
||||
whether you installed argcomplete system-wide using ``sudo`` or locally (into your user's home directory).
|
||||
|
||||
Zsh Support
|
||||
-----------
|
||||
Argcomplete supports zsh. On top of plain completions like in bash, zsh allows you to see argparse help strings as
|
||||
completion descriptions. All shellcode included with argcomplete is compatible with both bash and zsh, so the same
|
||||
completer commands ``activate-global-python-argcomplete`` and ``eval "$(register-python-argcomplete my-python-app)"``
|
||||
work for zsh as well.
|
||||
|
||||
Python Support
|
||||
--------------
|
||||
Argcomplete requires Python 3.7+.
|
||||
|
||||
Support for other shells
|
||||
------------------------
|
||||
Argcomplete maintainers provide support only for the bash and zsh shells on Linux and MacOS. For resources related to
|
||||
other shells and platforms, including fish, tcsh, xonsh, powershell, and Windows, please see the
|
||||
`contrib <https://github.com/kislyuk/argcomplete/tree/develop/contrib>`_ directory.
|
||||
|
||||
Common Problems
|
||||
---------------
|
||||
If global completion is not completing your script, bash may have registered a default completion function::
|
||||
|
||||
$ complete | grep my-python-app
|
||||
complete -F _minimal my-python-app
|
||||
|
||||
You can fix this by restarting your shell, or by running ``complete -r my-python-app``.
|
||||
|
||||
Debugging
|
||||
---------
|
||||
Set the ``_ARC_DEBUG`` variable in your shell to enable verbose debug output every time argcomplete runs. This will
|
||||
disrupt the command line composition state of your terminal, but make it possible to see the internal state of the
|
||||
completer if it encounters problems.
|
||||
|
||||
Acknowledgments
|
||||
---------------
|
||||
Inspired and informed by the optcomplete_ module by Martin Blais.
|
||||
|
||||
.. _optcomplete: http://pypi.python.org/pypi/optcomplete
|
||||
|
||||
Links
|
||||
-----
|
||||
* `Project home page (GitHub) <https://github.com/kislyuk/argcomplete>`_
|
||||
* `Documentation <https://kislyuk.github.io/argcomplete/>`_
|
||||
* `Package distribution (PyPI) <https://pypi.python.org/pypi/argcomplete>`_
|
||||
* `Change log <https://github.com/kislyuk/argcomplete/blob/master/Changes.rst>`_
|
||||
|
||||
Bugs
|
||||
~~~~
|
||||
Please report bugs, issues, feature requests, etc. on `GitHub <https://github.com/kislyuk/argcomplete/issues>`_.
|
||||
|
||||
License
|
||||
-------
|
||||
Copyright 2012-2023, Andrey Kislyuk and argcomplete contributors. Licensed under the terms of the
|
||||
`Apache License, Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0>`_. Distribution of the LICENSE and NOTICE
|
||||
files with source copies of this package and derivative works is **REQUIRED** as specified by the Apache License.
|
||||
|
||||
.. image:: https://github.com/kislyuk/argcomplete/workflows/Python%20package/badge.svg
|
||||
:target: https://github.com/kislyuk/argcomplete/actions
|
||||
.. image:: https://codecov.io/github/kislyuk/argcomplete/coverage.svg?branch=master
|
||||
:target: https://codecov.io/github/kislyuk/argcomplete?branch=master
|
||||
.. image:: https://img.shields.io/pypi/v/argcomplete.svg
|
||||
:target: https://pypi.python.org/pypi/argcomplete
|
||||
.. image:: https://img.shields.io/pypi/l/argcomplete.svg
|
||||
:target: https://pypi.python.org/pypi/argcomplete
|
||||
@@ -0,0 +1,4 @@
|
||||
argcomplete is a free open source library that integrates Python applications with Bash and Zsh shell completion.
|
||||
The argcomplete project is staffed by volunteers. If you are using this library in a for-profit project, please
|
||||
contribute to argcomplete development and maintenance using the "Sponsor" button on the argcomplete GitHub project page,
|
||||
https://github.com/kislyuk/argcomplete.
|
||||
@@ -0,0 +1,36 @@
|
||||
../../../bin/activate-global-python-argcomplete,sha256=iwCEyUXmUUwllKyS58JUhxNj35ZcFzBiVsEZBlo6DwM,5382
|
||||
../../../bin/python-argcomplete-check-easy-install-script,sha256=bEqIazhM14NkJ87d7UQyRURh4oPwr7AMQMuNxyYyRHQ,2640
|
||||
../../../bin/register-python-argcomplete,sha256=IiYtRDypsNysVTURTM0yn9MmB0GrcCkRHPVS7weBlzc,2028
|
||||
argcomplete-3.2.2.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
||||
argcomplete-3.2.2.dist-info/LICENSE.rst,sha256=DVQuDIgE45qn836wDaWnYhSdxoLXgpRRKH4RuTjpRZQ,10174
|
||||
argcomplete-3.2.2.dist-info/METADATA,sha256=fxHF2FhHlMc9DtgqUYKUucNIYQl5tRC8nyUoNoHxxVs,16585
|
||||
argcomplete-3.2.2.dist-info/NOTICE,sha256=LIicch7Irm12ZGgK-u-7THYgl29DS1elBuzZLwZJtqA,387
|
||||
argcomplete-3.2.2.dist-info/RECORD,,
|
||||
argcomplete-3.2.2.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
||||
argcomplete-3.2.2.dist-info/top_level.txt,sha256=iwsGO5-UxEhB809OsWbOmLjd8r8X1xtXY65mP01Ahlg,12
|
||||
argcomplete/__init__.py,sha256=yF6xrvfK0WpO8rlqQlilfScgXTJH1RSXcAMi5s4iZ6Q,693
|
||||
argcomplete/__pycache__/__init__.cpython-311.pyc,,
|
||||
argcomplete/__pycache__/_check_console_script.cpython-311.pyc,,
|
||||
argcomplete/__pycache__/_check_module.cpython-311.pyc,,
|
||||
argcomplete/__pycache__/completers.cpython-311.pyc,,
|
||||
argcomplete/__pycache__/exceptions.cpython-311.pyc,,
|
||||
argcomplete/__pycache__/finders.cpython-311.pyc,,
|
||||
argcomplete/__pycache__/io.cpython-311.pyc,,
|
||||
argcomplete/__pycache__/lexers.cpython-311.pyc,,
|
||||
argcomplete/__pycache__/shell_integration.cpython-311.pyc,,
|
||||
argcomplete/_check_console_script.py,sha256=fLZL8kMDr90BNZsLQWLPIgrPwZWxe919WawR_vXDmkc,2412
|
||||
argcomplete/_check_module.py,sha256=5cJ5K4uMs4T95h_FTdyw9WevbEzr3F1kIAoLmihop1k,2615
|
||||
argcomplete/bash_completion.d/_python-argcomplete,sha256=nRi9J8JD3cL3hhOdvw-w61ieQQycAYtuQofYdadm0vo,9852
|
||||
argcomplete/completers.py,sha256=sUAyopLZ2sLG-IiRGbivORDFcjjV2NyB--xgXW5Mpb8,3980
|
||||
argcomplete/exceptions.py,sha256=tojpetbrtcmabLRVC_YqiFGv0x-QzHPOIA2fEG6l9aA,112
|
||||
argcomplete/finders.py,sha256=RyRQk-IwDSuBZJLW73BBB06wcHWJ2WDB7-ptQnDFeqQ,27793
|
||||
argcomplete/io.py,sha256=PCepOaNi714v6aEzQ7AAltWDYo-aP5Xmbm6-fJ4ta5U,866
|
||||
argcomplete/lexers.py,sha256=se52bPTUK97m8oGDqP0mrwxQEUYMnOxvGQ2FdEo8v1U,2131
|
||||
argcomplete/packages/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||
argcomplete/packages/__pycache__/__init__.cpython-311.pyc,,
|
||||
argcomplete/packages/__pycache__/_argparse.cpython-311.pyc,,
|
||||
argcomplete/packages/__pycache__/_shlex.cpython-311.pyc,,
|
||||
argcomplete/packages/_argparse.py,sha256=uMS1sh_cLnIupsTsONWcRjIgiamQUPvwjRAQ12pLSpw,15846
|
||||
argcomplete/packages/_shlex.py,sha256=qeqIBAcTE_1Fz83Xz-1RrGciU7fvERJR7N_gctDGldg,12766
|
||||
argcomplete/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||
argcomplete/shell_integration.py,sha256=Nvw1lcNu13SZ0ChnrcgDLzgogfLWMt3oA1OUtMJkPzg,7377
|
||||
@@ -0,0 +1,5 @@
|
||||
Wheel-Version: 1.0
|
||||
Generator: bdist_wheel (0.42.0)
|
||||
Root-Is-Purelib: true
|
||||
Tag: py3-none-any
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
argcomplete
|
||||
Reference in New Issue
Block a user