Autogenerate completions for CLI tools built with argparse
Project description
Autogenerate Completions for CLI tools built with argparse
This package generates Fig completions for CLI tools built with Python's built-in argparse module.
Installation
Install the integration as a dependency using pip:
pip install argparse-complete-fig
Usage
import argparse
from argparse_complete_fig import add_completion_spec_command
parser = argparse.ArgumentParser(prog='my-cli')
# Call on your root-level parser for full completions
add_completion_spec_command(parser)
Calling the add_completion_spec_command
function will add
a --generate-fig-spec
argument to the parser. When your CLI is invoked
with this flag it will print a Fig spec.
To save your completion spec skeleton to a file, run the following:
my-cli --generate-fig-spec > my-cli.ts
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file argparse_complete_fig-1.0.1.tar.gz
.
File metadata
- Download URL: argparse_complete_fig-1.0.1.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e0b196b54167bab9ba8e9af6ca292db52381ab5ba427e5d39ba0978bb625e36 |
|
MD5 | e88441c27292641fc08a555306cb0b0f |
|
BLAKE2b-256 | bbf2c331e8a7cc02101f0feb5944926cf112926083bc24ebb72f5c14da4b15ba |
File details
Details for the file argparse_complete_fig-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: argparse_complete_fig-1.0.1-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13d9bcd03c9794828bee7eddc2dc0e627d8ef20400c92aaffda604b3449cd33c |
|
MD5 | fd028dbe2a4e4941d72dd7ff70fd2883 |
|
BLAKE2b-256 | 1c573a3517a7e52257094d473848a89324cc16e400a532c2bb9bc55250e28777 |