Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

cli-context

This is a library which supports CLI contexts for action hierarchies. For that, you have to use the CliContext class and create your own contexts.

Usage

Install this package with pip (or manually).

In your project, create a python file which will be called as a CLI entry-point:

import sys
from .my_entry_context import context as entry_ctx


if __name__ == "__main__":
    entry_ctx.run((sys.argv[0],), sys.argv[1:])

In my_entry_context.py:

from cli_context import CliContext

context = CliContext(
    "This is my fancy CLI",
    sub_contexts={
        "run": run_context,
        "do": another_context,
    }
)

About

Library which supports CLI contexts for action hierarchies

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages