def test_help_on_command():
    fn = args.function_for(commands, "documented")
    help_text = args.help_text('modargs', commands, on="documented")
    assert "Help for 'modargs documented'" in help_text
    assert "This is a very important command" in help_text
    assert "port - The TCP port on which to connect" in help_text
    assert "e.g. 'modargs documented --port 8825'" in help_text
    assert "Keyword Arguments" in help_text
Example #2
0
def test_help_on_command():
    fn = args.function_for(commands, "documented")
    help_text = args.help_text('modargs', commands, on="documented")
    assert "Help for 'modargs documented'" in help_text
    assert "This is a very important command" in help_text
    assert "port - The TCP port on which to connect" in help_text
    assert "e.g. 'modargs documented --port 8825'" in help_text
    assert "Keyword Arguments" in help_text
def help_text(on=False):
    return args.help_text(PROG, MOD, DEFAULT_COMMAND, on)
Example #4
0
def help_text(on=False):
    return args.help_text(PROG, MOD, setting("default-command"), on)
from modargs import args
from ordereddict import OrderedDict
import dexy.commands
import json

commands_and_help = OrderedDict()
for cmd in args.available_commands(dexy.commands):
    help_text = args.help_text('dexy', dexy.commands, 'dexy', on=cmd)
    commands_and_help[cmd] = help_text

with open("dexy--commands.json", "w") as f:
    json.dump(commands_and_help, f)
Example #6
0
def help_text(on=False):
    return args.help_text(PROG, MOD, Constants.DEFAULT_COMMAND, on)
def test_help():
    help_text = args.help_text('modargs', commands)
    assert "Available commands for modargs" in help_text
    assert "documented" in help_text
    assert "modargs help -on" in help_text
Example #8
0
def test_help():
    help_text = args.help_text('modargs', commands)
    assert "Available commands for modargs" in help_text
    assert "documented" in help_text
    assert "modargs help -on" in help_text