Skip to content

zhoujd/zzokapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 

Repository files navigation

zzokapi

Create entry script

cat > zz <<EOF
#!/usr/bin/env python3

# Script main entry

import os
import sys

coredirname = "zz-core"
topdir = ".."  # okapi top path
helpdoc = None

def main():
    # add import path
    srcdir = os.path.dirname(os.path.realpath(__file__)).replace("\\", "/")
    sys.path.append(os.path.abspath(os.path.join(srcdir, topdir)))

    from okapi.utils import common
    from okapi.framework import dispatch

    common.setcoredir(coredirname)
    workdir = common.getworkdir()
    dispatcher = dispatch.Dispatch(workdir, srcdir, sys.argv, helpdoc);
    dispatcher.run()


if __name__ == '__main__':
    try:
        main()
    except KeyboardInterrupt:
        print("\nUser Press Ctrl+C, exit\n")
EOF
$ chmod +x zz

Create sub commands

$ mkdir zz-core
$ cd zz-core
$ vim test.sh
$ chmod +x test.sh
$ zz
Use: zz test [argv]

About

Git command style command line tool

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •