catsup v1.0 Usage: catsup init [<path>] catsup build catsup deploy catsup -h | --help catsup --version Options: -h --help show this screen. -s --settings=<file> specify a config file. [default: config.json] """ from parguments import Parguments parguments = Parguments(__doc__, version='1.0') @parguments.command def init(path): """ Usage: catsup init [<path>] Options: -h --help show this screen. -s --settings=<file> specify a setting file. [default: config.json] """ pass @parguments.command def build(settings):
catsup install <theme> catsup -h | --help catsup --version Options: -h --help Show this screen and exit. -s --settings=<file> specify a config file. [default: config.json] -f --file=<file> specify a wordpress output file. -o --output=<dir> specify a output folder. [default: .] -p --port=<port> specify the server port. [default: 8888] -g --global install theme to global theme folder. """ % catsup.__version__ from parguments import Parguments parguments = Parguments(doc, version=catsup.__version__) @parguments.command def init(path): """ Usage: catsup init [<path>] Options: -h --help Show this screen and exit. """ from catsup.parser.utils import create_config_file create_config_file(path)
""" import os import yaml import requests import dash_py PACKAGES_PATH = os.path.join(os.path.abspath(os.path.dirname(__file__)), "packages") from bs4 import BeautifulSoup from parguments import Parguments from .installer import install_package from .utils import enable_pretty_logging, logger, resource_exist parguments = Parguments(__doc__, version=dash_py.__version__) @parguments.command def install(name): """ Usage: dash.py install <name>... Options: -h --help Show this screen and exit. """ if isinstance(name, list): return [install(n) for n in name] content = ""
def test_help(): p = Parguments(__doc__) assert p.run(argv=["-h"], exit=False) == 0 assert p.run(argv=["--help"], exit=False) == 0
def test_adding_commands(): p = Parguments(__doc__) assert p._commands == {} @p.command def add(name): """ Usage: parguments add <name> """ assert name == "catsup" assert "add" in p._commands def remove(name): """ Usage: parguments remove <name> """ assert name == "wordpress" p.add_command(remove) assert "remove" in p._commands p.run(argv=["add", "catsup"], exit=False) p.run(command="add", argv=["remove", "catsup"], exit=False) import sys sys.argv[1:] = ["add", "catsup"] p.run(exit=False) try: p.run(argv=["remove", "wordpress"]) except SystemExit: pass else: raise
git [--help] The most commonly used git commands are: add Add file contents to the index branch List, create, or delete branches checkout Checkout a branch or paths to the working tree clone Clone a repository into a new directory commit Record changes to the repository push Update remote refs along with associated objects remote Manage set of tracked repositories See 'git help <command>' for more information on a specific command. """ git = Parguments(doc, version='git version 1.7.4.4', options_first=True) @git.command def add(args): """ usage: git add [options] [--] [<filepattern>...] -h, --help -n, --dry-run dry run -v, --verbose be verbose -i, --interactive interactive picking -p, --patch select hunks interactively -e, --edit edit current diff and apply -f, --force allow adding otherwise ignored files
import aam doc = """Aam v%s Usage: aam init aam build aam -h | --help aam --version Options: -h --help Show this screen and exit. """ % aam.__version__ from parguments import Parguments parguments = Parguments(doc, version=aam.__version__) def pre_init(): hub.root.path = os.path.dirname(__file__) hub.root.template_path = os.path.join(os.path.dirname(__file__), 'templates') hub.root.static_path = os.path.join(os.path.dirname(__file__), 'static') hub.site.path = os.getcwd() hub.site.page_path = os.path.join(hub.site.path, 'pages') hub.site.deploy_path = os.path.join(hub.site.path, 'deploy') hub.site.static_path = os.path.join(hub.site.deploy_path, 'static') @parguments.command def init():