Skip to main content

cmd2-abbrev

Description

Plugin for cmd2 to support previously deprecated abbreviation behavior.

Adds a setting abbrev which allows users to control whether commands can be abbreviated. If an application has a speak command:

(Cmd) speak hello
hello

then any unique prefix of any command will run the command:

(Cmd) set abbrev True
abbrev - was: False
now: True
(Cmd) sp hello
hello

Non-unique abbreviations generate a syntax error:

(Cmd) s hello
*** Unknown syntax: s hello
(Cmd) help

Documented commands (type help <topic>):
========================================
alias  help     load  pyscript  set    shortcuts  unalias
edit   history  py    quit      shell  speak

Installation

System requirements: works anywhere cmd2 works (Windows, Linux, MacOS). Requires cmd2 version 0.9.12 or higher.

Install using pip:

$ pip install cmd2-abbrev

Add to your cmd2 application by mixing in the AbbrevMixin class:

import cmd2
import cmd2_abbrev

class AbbrevExample(cmd2_abbrev.AbbrevMixin, cmd2.Cmd):
    """A cmd2 program to demonstrate the use of the cmd2_abbrev plugin"""
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

You must mix in AbbrevMixin before cmd2.Cmd or it won't work properly.

Metadata

Release files for cmd2-abbrev 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cmd2-abbrev 1.1.0
File Size Uploaded Provenance
cmd2-abbrev-1.1.0.tar.gz 11.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for cmd2-abbrev 1.1.0
File Interpreter ABI Platform
cmd2_abbrev-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 15.4 kB

Release files / cmd2-abbrev-1.1.0.tar.gz

Download URL cmd2-abbrev-1.1.0.tar.gz
Size 11.3 kB
Tags Source
SHA-256 checksum
How to use checksums
771c3913b03940f326b3f7dd1a6c8fd7dc5a0b3b83fdd6d6a4b90ba0c5fb66e6
BLAKE2b-256 checksum
How to use checksums
787ca11a698a66a741d7129ce585cfae73770dfe447bc635d895ad3d83ff367e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.1

Release files / cmd2_abbrev-1.1.0-py3-none-any.whl

Download URL cmd2_abbrev-1.1.0-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f802e9048ed59e914013299042377ea4ba351bfb04d3341f6c536306753754bd
BLAKE2b-256 checksum
How to use checksums
293c9673a0da1c06e6557e18f7c25359ab1406dbaa9b21bd64293e428534ce67
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.1

Security for cmd2-abbrev 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page