No project description provided
Project description
gitlike-commands
Background
gitlike-commands
is a python module for easily creating git
-style subcommand handling.
Refactored out of thelogrus so you don't have to import any modules that aren't part of the Python standard library.
Usage
subcommand_driver
automatically figures out what name the script was called as, then looks for subcommands and runs them if found, passing in any command line options.
So if you have a foo
script in your $PATH
as shown below
#!/usr/bin/env python3
from gitlike_commands import subcommand_driver
if __name__ == '__main__':
subcommand_driver()
Running foo bar baz
will look for a foo-bar-baz
script, and if present in your $PATH
, run it. If there is no foo-bar-baz
, it will look for foo-bar
, and if it finds that, run foo-bar baz
.
If you're using poetry in your python project, you can add a gitlike driver as a scripts entry:
[tool.poetry.scripts]
gitalike-demo = "gitlike_commands:subcommand_driver"
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
Built Distribution
Hashes for gitlike_commands-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1668cb3602738ae219b3b7a4e83546f8563590ffd10802dcd76f131474d007c |
|
MD5 | 75cd2e5289b0bd3118a14e8b927d4e47 |
|
BLAKE2b-256 | 8c53bcfbc10058693e2f8559d16731dd7ee0295a122ef9edd3f8d3fb68abf49a |