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
Close
Hashes for argparse_complete_fig-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a29ade6e6e80cbf6e1ef53e26221b431f7bbe85b4f1253f00f641adc39371d3 |
|
MD5 | df9995f0e138eb5f478c14b313022b2a |
|
BLAKE2b-256 | e38337ab610a31ee477818455804866ca76e506600e9cd833c74ff3dd43c9f49 |
Close
Hashes for argparse_complete_fig-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8846c5083eeeaad8d16d836479400ae2eded8463556011b77f4aa6be9f8abfa5 |
|
MD5 | 57162a3497786f5cbe67be6ce7e50ec9 |
|
BLAKE2b-256 | cc9aa81a232e4cc5c100d73a25aefdb12002b891ea5b33f5027ddad2053a005a |