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.0.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.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: quickopts-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 9f74c3c8c8f8ed52223db82ef4b48712ecdbaf8af39c2c11e4ee006a1af5102a
MD5 d4b09c460169eac8967208643349080b
BLAKE2b-256 95936a4f37e01948e5809ec911d5a90c8bd25207d3c38095a91d2b6d609905a6

See more details on using hashes here.

Provenance

The following attestation bundles were made for quickopts-0.1.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: quickopts-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 baca619d37ad6b9628b8cec1a6fc19b1b39a72e657d726e3b1cc62b7b9c3fef5
MD5 c3a4ea0201d9c120604b400d26733ab6
BLAKE2b-256 6a2c20ef5e108d80f22fb5203862c53c5f7e37f77e59e752c7fd873d8d0fd52a

See more details on using hashes here.

Provenance

The following attestation bundles were made for quickopts-0.1.0-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