1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-03-13 22:28:33 +00:00

Updated to refelect interactive mode instead of dry as the comment stream on github suggested.

This commit is contained in:
Jacob Ebey 2015-04-20 11:53:06 -07:00
parent bc7dd5c762
commit bbf3521a58

View File

@ -82,8 +82,8 @@ def is_second_run(command):
def main():
parser = argparse.ArgumentParser(description='The fuck?')
parser.add_argument('--dry', dest='do_it_dry', type=bool, default=False,
help='Do a dry fuck. (Dry run)')
parser.add_argument('-i', dest='interactive', type=bool, default=False,
help='Enter interactive mode.')
opts = parser.parse_args(sys.argv)
command = get_command(sys.argv)
@ -97,10 +97,9 @@ def main():
if matched_rule:
print(rule.get_new_command(command, settings))
if opts.do_it_dry:
answer = input('Run command? [Y/n]: ')
if answer.lower() != 'y':
return
run_rule(matched_rule, command, settings)
if opts.interactive:
answer = input('Run command? [Y/n]: ').strip().lower()
if answer == '' or answer == 'y':
run_rule(matched_rule, command, settings)
else:
print('echo No fuck given')