xontrib-argcomplete


Namexontrib-argcomplete JSON
Version 0.3.4 PyPI version JSON
download
home_pagehttps://github.com/anki-code/xontrib-argcomplete
SummaryArgcomplete support for python and xonsh scripts in xonsh shell.
upload_time2024-12-26 15:40:51
maintainerNone
docs_urlNone
authoranki-code
requires_python>=3.6
licenseBSD
keywords
VCS
bugtrack_url
requirements argcomplete xonsh pytest
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <p align="center">
<a href="https://github.com/kislyuk/argcomplete">Argcomplete</a> support for python and xonsh scripts in <a href="https://xon.sh">xonsh</a> shell.
</p>

<p align="center">  
If you like the idea click ⭐ on the repo and and <a href="https://twitter.com/intent/tweet?text=Nice%20xontrib%20for%20the%20xonsh%20shell!&url=https://github.com/anki-code/xontrib-argcomplete" target="_blank">tweet</a>.
</p>

<p align="center">  
<img src="https://raw.githubusercontent.com/anki-code/xontrib-argcomplete/master/static/xontrib-argcomplete-demo.png" alt="[Demo]"><br />
<sup><i>Screenshot made with <a href="https://github.com/anki-code/xontrib-prompt-bar">xontrib-prompt-bar</a> and <a href="https://konsole.kde.org/">Konsole</a>.</i></sup>
</p>

## Install
```shell script
xpip install xontrib-argcomplete
echo 'xontrib load argcomplete' >> ~/.xonshrc
# Reload xonsh
```

## Usage

First of all you need to [add the argcomplete support to your script](https://kislyuk.github.io/argcomplete/#synopsis):
* The `PYTHON_ARGCOMPLETE_OK` marker should be found in the first 10 lines of the file ([example](https://github.com/anki-code/xontrib-argcomplete/blob/37e24660351780501eed64a2a77cb2a3309c109c/tests/proto.py#L2)).
* Additional `.completer` was set for `add_argument` ([example](https://github.com/anki-code/xontrib-argcomplete/blob/37e24660351780501eed64a2a77cb2a3309c109c/tests/proto.py#L7)).
* `argcomplete.autocomplete(parser)` added before `parser.parse_args()` ([example](https://github.com/anki-code/xontrib-argcomplete/blob/37e24660351780501eed64a2a77cb2a3309c109c/tests/proto.py#L8)).

Example for [`proto.py`](https://github.com/anki-code/xontrib-argcomplete/blob/master/tests/proto.py) sample:
```xsh
xpip install xontrib-argcomplete
xontrib load argcomplete

cd /tmp && git clone https://github.com/anki-code/xontrib-argcomplete
cd xontrib-argcomplete/tests

python proto.py <Tab>  # Suggestions: --help --proto -h
./proto.py --proto tt<Tab>  # Suggestions: http https
./proto.xsh --proto tt<Tab>  # Suggestions: http https
./proto --proto tt<Tab>  # Suggestions: http https

$PATH.append($PWD)
proto --proto tt<Tab>  # Suggestions: http https
```

The argcomplete xonsh completer will be activated with this cases:
```xsh
python script.py <Tab>
./script.py <Tab>
./path/script.py <Tab>

xonsh script.xsh <Tab>
./script.xsh <Tab>
./path/script.xsh <Tab>

# scripts without extension should have "env python" or "env xonsh" or path to python/xonsh in the shebang
./script <Tab>
script <Tab>    # script should be found in $PATH
```

## Known issues

Windows is not supported. PRs are welcome!

## Development
* To switch on the debug mode run `$XONTRIB_ARGCOMPLETE_DEBUG = True`.
* [Argcomplete environment variables](https://github.com/kislyuk/argcomplete/issues/319#issuecomment-693295017)
* [Argcomplete documentation](https://kislyuk.github.io/argcomplete/)

## Links 
* This package is the part of [ergopack](https://github.com/anki-code/xontrib-ergopack) - the pack of ergonomic xontribs.
* This package was created with [xontrib cookiecutter template](https://github.com/xonsh/xontrib-cookiecutter).

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/anki-code/xontrib-argcomplete",
    "name": "xontrib-argcomplete",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": null,
    "author": "anki-code",
    "author_email": "xonsh@googlegroups.com",
    "download_url": "https://files.pythonhosted.org/packages/51/a4/f99338ec4b45be0547417cdc38e20a5c748bb5e10be8c88d0184d2d1f27b/xontrib_argcomplete-0.3.4.tar.gz",
    "platform": "any",
    "description": "<p align=\"center\">\n<a href=\"https://github.com/kislyuk/argcomplete\">Argcomplete</a> support for python and xonsh scripts in <a href=\"https://xon.sh\">xonsh</a> shell.\n</p>\n\n<p align=\"center\">  \nIf you like the idea click \u2b50 on the repo and and <a href=\"https://twitter.com/intent/tweet?text=Nice%20xontrib%20for%20the%20xonsh%20shell!&url=https://github.com/anki-code/xontrib-argcomplete\" target=\"_blank\">tweet</a>.\n</p>\n\n<p align=\"center\">  \n<img src=\"https://raw.githubusercontent.com/anki-code/xontrib-argcomplete/master/static/xontrib-argcomplete-demo.png\" alt=\"[Demo]\"><br />\n<sup><i>Screenshot made with <a href=\"https://github.com/anki-code/xontrib-prompt-bar\">xontrib-prompt-bar</a> and <a href=\"https://konsole.kde.org/\">Konsole</a>.</i></sup>\n</p>\n\n## Install\n```shell script\nxpip install xontrib-argcomplete\necho 'xontrib load argcomplete' >> ~/.xonshrc\n# Reload xonsh\n```\n\n## Usage\n\nFirst of all you need to [add the argcomplete support to your script](https://kislyuk.github.io/argcomplete/#synopsis):\n* The `PYTHON_ARGCOMPLETE_OK` marker should be found in the first 10 lines of the file ([example](https://github.com/anki-code/xontrib-argcomplete/blob/37e24660351780501eed64a2a77cb2a3309c109c/tests/proto.py#L2)).\n* Additional `.completer` was set for `add_argument` ([example](https://github.com/anki-code/xontrib-argcomplete/blob/37e24660351780501eed64a2a77cb2a3309c109c/tests/proto.py#L7)).\n* `argcomplete.autocomplete(parser)` added before `parser.parse_args()` ([example](https://github.com/anki-code/xontrib-argcomplete/blob/37e24660351780501eed64a2a77cb2a3309c109c/tests/proto.py#L8)).\n\nExample for [`proto.py`](https://github.com/anki-code/xontrib-argcomplete/blob/master/tests/proto.py) sample:\n```xsh\nxpip install xontrib-argcomplete\nxontrib load argcomplete\n\ncd /tmp && git clone https://github.com/anki-code/xontrib-argcomplete\ncd xontrib-argcomplete/tests\n\npython proto.py <Tab>  # Suggestions: --help --proto -h\n./proto.py --proto tt<Tab>  # Suggestions: http https\n./proto.xsh --proto tt<Tab>  # Suggestions: http https\n./proto --proto tt<Tab>  # Suggestions: http https\n\n$PATH.append($PWD)\nproto --proto tt<Tab>  # Suggestions: http https\n```\n\nThe argcomplete xonsh completer will be activated with this cases:\n```xsh\npython script.py <Tab>\n./script.py <Tab>\n./path/script.py <Tab>\n\nxonsh script.xsh <Tab>\n./script.xsh <Tab>\n./path/script.xsh <Tab>\n\n# scripts without extension should have \"env python\" or \"env xonsh\" or path to python/xonsh in the shebang\n./script <Tab>\nscript <Tab>    # script should be found in $PATH\n```\n\n## Known issues\n\nWindows is not supported. PRs are welcome!\n\n## Development\n* To switch on the debug mode run `$XONTRIB_ARGCOMPLETE_DEBUG = True`.\n* [Argcomplete environment variables](https://github.com/kislyuk/argcomplete/issues/319#issuecomment-693295017)\n* [Argcomplete documentation](https://kislyuk.github.io/argcomplete/)\n\n## Links \n* This package is the part of [ergopack](https://github.com/anki-code/xontrib-ergopack) - the pack of ergonomic xontribs.\n* This package was created with [xontrib cookiecutter template](https://github.com/xonsh/xontrib-cookiecutter).\n",
    "bugtrack_url": null,
    "license": "BSD",
    "summary": "Argcomplete support for python and xonsh scripts in xonsh shell.",
    "version": "0.3.4",
    "project_urls": {
        "Code": "https://github.com/anki-code/xontrib-argcomplete",
        "Documentation": "https://github.com/anki-code/xontrib-argcomplete/blob/master/README.md",
        "Homepage": "https://github.com/anki-code/xontrib-argcomplete",
        "Issue tracker": "https://github.com/anki-code/xontrib-argcomplete/issues"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3651798dde809b588b06aa41295c7dbad427a5598ed77415b5471f3a43e48621",
                "md5": "075dba88ea9187e3811936297b49da09",
                "sha256": "ae7798e8f97dd0db02de82075af000e2bb787385084128b412311301e0ef7271"
            },
            "downloads": -1,
            "filename": "xontrib_argcomplete-0.3.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "075dba88ea9187e3811936297b49da09",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 5377,
            "upload_time": "2024-12-26T15:40:49",
            "upload_time_iso_8601": "2024-12-26T15:40:49.136790Z",
            "url": "https://files.pythonhosted.org/packages/36/51/798dde809b588b06aa41295c7dbad427a5598ed77415b5471f3a43e48621/xontrib_argcomplete-0.3.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "51a4f99338ec4b45be0547417cdc38e20a5c748bb5e10be8c88d0184d2d1f27b",
                "md5": "29d057a15c85a6805333220e26690ce9",
                "sha256": "9a9d652e91976a1e183138075f5757d0894f75287878e90a52f21b1dbc91a451"
            },
            "downloads": -1,
            "filename": "xontrib_argcomplete-0.3.4.tar.gz",
            "has_sig": false,
            "md5_digest": "29d057a15c85a6805333220e26690ce9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 5926,
            "upload_time": "2024-12-26T15:40:51",
            "upload_time_iso_8601": "2024-12-26T15:40:51.611391Z",
            "url": "https://files.pythonhosted.org/packages/51/a4/f99338ec4b45be0547417cdc38e20a5c748bb5e10be8c88d0184d2d1f27b/xontrib_argcomplete-0.3.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-26 15:40:51",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "anki-code",
    "github_project": "xontrib-argcomplete",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "argcomplete",
            "specs": []
        },
        {
            "name": "xonsh",
            "specs": []
        },
        {
            "name": "pytest",
            "specs": []
        }
    ],
    "lcname": "xontrib-argcomplete"
}
        
Elapsed time: 2.96513s