Skip to main content

Command line builder library

Project description

cmdliner

The usage was inspired on Cleo .

from cmdliner import Command


class GreetCommand(Command):
    """
    Greets someone

    greet
        {name?'' : Who do you want to greet?}
        {--y|yell : If set, the task will yell in uppercase letters}
    """

    def handle(self, name, yell):
        if name:
            text = 'Hello {}'.format(name)
        else:
            text = 'Hello'

        if yell:
            text = text.upper()

        print(text)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cmdliner-0.0.0.tar.gz (7.9 kB view hashes)

Uploaded Source

Built Distribution

cmdliner-0.0.0-py3-none-any.whl (6.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page