Thefuck: allow for a flag that executes immediately

Created on 25 Jul 2016  Â·  10Comments  Â·  Source: nvbn/thefuck

I often do the same git push to a new brach that needs --set-upstream origin ... to create a new branch. fuck can fix this, but it forces me to press enter even though I know what input it needs. I _could_ get an alias that creates a branch immediately and don't require fuck at all anymore, but I'd prefer to be able to fuck -y that executes the suggested command immediately.

next release

Most helpful comment

So I've checked a bit, and alias like:

alias fuck-it='export THEFUCK_REQUIRE_CONFIRMATION=False; fuck; export THEFUCK_REQUIRE_CONFIRMATION=True'

should work.

All 10 comments

Try with the following entry in ~/.config/thefuck/settings.py:

require_confirmation = False

But what if I want to do it by default with confirmation and just once without, so with a flag; would fuck -y be possible?

Yes, at shell alias/function level.

@Haroenv are you willing to code it? 😃 What shell do you commonly use?

I use Fish usually, and yes, I'll look at how this would work internally

Awesome! I use Fish too! Please feel free to ask for help, although I'm sure you'll nail it :o)

So I've checked a bit, and alias like:

alias fuck-it='export THEFUCK_REQUIRE_CONFIRMATION=False; fuck; export THEFUCK_REQUIRE_CONFIRMATION=True'

should work.

Thanks, and sorry for not following up on the PR

After changes in #620 we can have -y/--yes:

➜ git br
git: 'br' is not a git command. See 'git --help'.

Did you mean one of these?
    branch
    var
➜  fuck -y
git branch
* 614-repeate-option
  620-command-line-arguments
  Asday-master

Implemented in 3.16.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

caesar picture caesar  Â·  5Comments

AlexWayfer picture AlexWayfer  Â·  4Comments

agross picture agross  Â·  5Comments

radjivF picture radjivF  Â·  4Comments

disjunto picture disjunto  Â·  6Comments