<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def compare(args):
 """ Compare the extant river with the given name to the passed JSON. The command will exit with a return code of 0 if the named river is configured as specified, and 1 otherwise. """

    data = json.load(sys.stdin)
    m = RiverManager(args.hosts)
    if m.compare(args.name, data):
        sys.exit(0)
    else:
        sys.exit(1)