Skip to main content

A tiny opinionated Python library for parsing script options.

Project description

quickopts

A tiny opinionated Python library for parsing script options.

Quickstart

"""A cool tool

Synopsis:
  $prog [-L]
  $prog -C [-zb BRANCH]
  $prog -D VAL
  $prog -W [--] [ARGS...]

Commands:
  -C  Create a value.
  -D  Delete a value.
  -L  List all the values.
  -W  Wrap a command.
  -h  Show this message and exit.

Options:
  -b BRANCH  Name of the value's branch.
  -z         Sleep for a little while first.
"""

import quickopts


if __name__ == "__main__":
    q = quickopts.parse_or_exit(__doc__, program_var="prog")
    match q.command or "L":
        case "C":
            _create(branch=q.flags["b"], sleep="z" in q.switches)
        case "D":
            _delete(q.args[0])
        case "L": ...
        case "W": ...

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

quickopts-0.1.3.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

quickopts-0.1.3-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file quickopts-0.1.3.tar.gz.

File metadata

  • Download URL: quickopts-0.1.3.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for quickopts-0.1.3.tar.gz
Algorithm Hash digest
SHA256 19fcc632edd2710f1372050530cfbfaada33ac9b034e667d42dc7df27340f2b3
MD5 9def369faedd5dcab82f138ed836fe70
BLAKE2b-256 842a6501249cb79ddfd146dc4114e26c89da690616710ee5b6cae6c057c1b776

See more details on using hashes here.

Provenance

The following attestation bundles were made for quickopts-0.1.3.tar.gz:

Publisher: ci.yaml on mtth/quickopts

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file quickopts-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: quickopts-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for quickopts-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e5e04cc9e4156e78e755f0c60cbd795b268525ad8c4b9117673bc99520fb9b83
MD5 cb6d04fdb313097b6855d82faca1a04f
BLAKE2b-256 16236f5f9c8ee59d4f03bb44d51b8b7b00d5261a15282a08b4b5260ecca78fcf

See more details on using hashes here.

Provenance

The following attestation bundles were made for quickopts-0.1.3-py3-none-any.whl:

Publisher: ci.yaml on mtth/quickopts

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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