def makecommands(rules):
    """Returns a list of commands consumable by histedit --commands based on
    our list of rules"""
    commands = []
    for rules in rules:
        commands.append(b'%s %s\n' % (rules.action, rules.ctx))
    return commands
