Skip to main content

redcmd

A simple library to handle command line of an application with support for subcommands, as well as, automatic help text extraction from doc strings.

Supported platforms

  • python 2.7 / 3.4

  • Linux / Windows

Features

  • Decorator as well as subclass based command addition.

  • Custom help text formatter which improves upon the rather lousy default formatter.

  • Automatic help text extraction from doc strings.

  • Autocomplete support (Linux only).

Usage

A simple case of just the main command (without any subcommands):

from redcmd.api import maincmd, execute_commandline

@maincmd
def main(a, b):
        '''Add two numbers.
        a:      first number
        b:      second number

        This is where extra help text goes.
        It can be more than one line.'''

        try:
                print('sum: %d'%(int(a) + int(b)))
        except ValueError:
                print('bad integer')
                raise CommandError()

execute_commandline()

See examples directory in code for decorator and subclass based command handling. [https://github.com/amol9/redcmd/tree/master/examples]

Download

Metadata

Release files for redcmd 1.2.10

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

Source distribution (sdist)

Source distribution for redcmd 1.2.10
File Size Uploaded Provenance Actions
redcmd-1.2.10.tar.gz 24.1 kB Without provenance Details for redcmd-1.2.10.tar.gz

Release files / redcmd-1.2.10.tar.gz

Download URL redcmd-1.2.10.tar.gz
Size 24.1 kB
Tags Source
SHA-256 checksum
How to use checksums
86a2ec97f3f6f88c9ccb60418e17960248ae05bd4d127914b2f0d7e3788632bf
BLAKE2b-256 checksum
How to use checksums
48f299ba0f9b7e073fa8eec723a46a202ce423ca64f7a69c01308748a969b18c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for redcmd 1.2.10

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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