Skip to main content

LUPE: a better cli app helper

Project description

When it comes to build command-line apps, there is nothing like LUPE

Install

$ pip install lupe

Features

  • Parses arguments
  • Outputs version when --version or -v
  • Outputs description and supplied help text when --help or -h

Usage

There is not mango emoji yet supported. So instead, I used a pear, but it kinda looks the same 😒

$ ./foo.py dinner --mango
#!/usr/bin/python
# -*- coding: UTF-8 -*-

from lupe import *
from foo import *

cli = lupe(`
	Usage
	  $ foo <input>

	Options
	  --mango, -m  Include a mango

	Examples
	  $ foo dinner --mango
	  	dinner 🍐
`, {
	flags: {
		mango: {
			type: 'boolean',
			alias: 'm'
		}
	}
});
/*
{
	input: ['dinner'],
	flags: {mango: true},
	...
}
*/

foo(cli.input[0], cli.flags);

Credit

Based on meow from @Sindresorhus

Team

Carlos Abraham Logo
Carlos Abraham

License

MIT License © Carlos Abraham

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

lupe-0.1.0a0-py2-none-any.whl (2.1 kB view details)

Uploaded Python 2

File details

Details for the file lupe-0.1.0a0-py2-none-any.whl.

File metadata

File hashes

Hashes for lupe-0.1.0a0-py2-none-any.whl
Algorithm Hash digest
SHA256 e47ed673b3e99949f4ea9d676ace34c1742095c14985cd63c4a0b97ebb760c1a
MD5 3f8790dbdf92ed910b1a74fc96d59a50
BLAKE2b-256 71c5e63792e0eb7157bf5443ac1917696bc6632fe98ba8100a78098c3f9b2fda

See more details on using hashes here.

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