mirror of
https://github.com/nvbn/thefuck.git
synced 2025-03-20 09:39:01 +00:00
Updated to refelect interactive mode instead of dry as the comment stream on github suggested.
This commit is contained in:
parent
bc7dd5c762
commit
bbf3521a58
@ -82,8 +82,8 @@ def is_second_run(command):
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
parser = argparse.ArgumentParser(description='The fuck?')
|
parser = argparse.ArgumentParser(description='The fuck?')
|
||||||
parser.add_argument('--dry', dest='do_it_dry', type=bool, default=False,
|
parser.add_argument('-i', dest='interactive', type=bool, default=False,
|
||||||
help='Do a dry fuck. (Dry run)')
|
help='Enter interactive mode.')
|
||||||
opts = parser.parse_args(sys.argv)
|
opts = parser.parse_args(sys.argv)
|
||||||
|
|
||||||
command = get_command(sys.argv)
|
command = get_command(sys.argv)
|
||||||
@ -97,10 +97,9 @@ def main():
|
|||||||
if matched_rule:
|
if matched_rule:
|
||||||
print(rule.get_new_command(command, settings))
|
print(rule.get_new_command(command, settings))
|
||||||
|
|
||||||
if opts.do_it_dry:
|
if opts.interactive:
|
||||||
answer = input('Run command? [Y/n]: ')
|
answer = input('Run command? [Y/n]: ').strip().lower()
|
||||||
if answer.lower() != 'y':
|
if answer == '' or answer == 'y':
|
||||||
return
|
|
||||||
run_rule(matched_rule, command, settings)
|
run_rule(matched_rule, command, settings)
|
||||||
else:
|
else:
|
||||||
print('echo No fuck given')
|
print('echo No fuck given')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user