(self, equal_zero=False, result=1)
| 46 | self.add_command("grep -q -F {} {}".format(quote(text), file or '.tmp.output')) |
| 47 | |
| 48 | def check(self, equal_zero=False, result=1): |
| 49 | op = 'eq' if equal_zero else 'ne' |
| 50 | cmds = ['RES=$?', |
| 51 | 'if [ $RES -{} "0" ]; then'.format(op), |
| 52 | ' exit {}'.format(result), |
| 53 | 'fi'] |
| 54 | self.commands.extend(cmds) |
| 55 | |
| 56 | def write(self, p): |
| 57 | write_to(p, self.commands) |