pax_global_header00006660000000000000000000000064127540426030014515gustar00rootroot0000000000000052 comment=c63e0d1582dcc8eba392abd352d56a64a7d30287 thefuck-3.11/000077500000000000000000000000001275404260300130725ustar00rootroot00000000000000thefuck-3.11/.gitignore000066400000000000000000000013501275404260300150610ustar00rootroot00000000000000# Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] # C extensions *.so # Distribution / packaging .Python env/ build/ develop-eggs/ dist/ downloads/ eggs/ .eggs/ lib/ lib64/ parts/ sdist/ var/ *.egg-info/ .installed.cfg *.egg # PyInstaller # Usually these files are written by a python script from a template # before PyInstaller builds the exe, so as to inject date/other infos into it. *.manifest *.spec # Installer logs pip-log.txt pip-delete-this-directory.txt # Unit test / coverage reports htmlcov/ .tox/ .coverage .coverage.* .cache nosetests.xml coverage.xml *,cover # Translations *.mo *.pot # Django stuff: *.log # Sphinx documentation docs/_build/ # PyBuilder target/ .env .idea # vim temporary files .*.swp thefuck-3.11/.travis.yml000066400000000000000000000025161275404260300152070ustar00rootroot00000000000000language: python sudo: false matrix: include: - os: linux dist: trusty python: "3.5" - os: linux dist: trusty python: "3.4" - os: linux dist: trusty python: "3.3" - os: linux dist: trusty python: "2.7" - os: osx env: FORMULA="python" language: generic - os: osx env: FORMULA="python3" language: generic services: - docker addons: apt: packages: - python-commandnotfound - python3-commandnotfound before_install: - if [[ $TRAVIS_OS_NAME == "osx" ]]; then brew update ; fi - if [[ $TRAVIS_OS_NAME == "osx" ]]; then brew install $FORMULA; fi - if [[ $TRAVIS_OS_NAME == "osx" ]]; then virtualenv venv -p $FORMULA; fi - if [[ $TRAVIS_OS_NAME == "osx" ]]; then source venv/bin/activate; fi - pip install -U pip - pip install -U coveralls install: - pip install -Ur requirements.txt - python setup.py develop - rm -rf build script: - export COVERAGE_PYTHON_VERSION=python-${TRAVIS_PYTHON_VERSION:0:1} - export RUN_TESTS="coverage run --source=thefuck,tests -m py.test -v --capture=sys tests" - if [[ $TRAVIS_PYTHON_VERSION == 3.5 && $TRAVIS_OS_NAME != "osx" ]]; then $RUN_TESTS --enable-functional; fi - if [[ $TRAVIS_PYTHON_VERSION != 3.5 || $TRAVIS_OS_NAME == "osx" ]]; then $RUN_TESTS; fi after_success: - coveralls thefuck-3.11/CONTRIBUTING.md000066400000000000000000000022611275404260300153240ustar00rootroot00000000000000# Report issues If you have any issue with The Fuck, sorry about that, but we will do what we can to fix that. Actually, maybe we already have, so first thing to do is to update The Fuck and see if the bug is still there. If it is (sorry again), check if the problem has not already been reported and if not, just open an issue on [GitHub](https://github.com/nvbn/thefuck) with the following basic information: - the output of `thefuck --version` (something like `The Fuck 3.1 using Python 3.5.0`); - your shell and its version (`bash`, `zsh`, *Windows PowerShell*, etc.); - your system (Debian 7, ArchLinux, Windows, etc.); - how to reproduce the bug; - the output of The Fuck with `THEFUCK_DEBUG=true` exported (typically execute `export THEFUCK_DEBUG=true` in your shell before The Fuck); - if the bug only appears with a specific application, the output of that application and its version; - anything else you think is relevant. It's only with enough information that we can do something to fix the problem. # Make a pull request We gladly accept pull request on the [official repository](https://github.com/nvbn/thefuck) for new rules, new features, bug fixes, etc. thefuck-3.11/LICENSE.md000066400000000000000000000021221275404260300144730ustar00rootroot00000000000000The MIT License (MIT) ===================== Copyright (c) 2015 Vladimir Iakovlev Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. thefuck-3.11/MANIFEST.in000066400000000000000000000000231275404260300146230ustar00rootroot00000000000000include LICENSE.md thefuck-3.11/README.md000066400000000000000000000404531275404260300143570ustar00rootroot00000000000000# The Fuck [![Version][version-badge]][version-link] [![Build Status][travis-badge]][travis-link] [![Windows Build Status][appveyor-badge]][appveyor-link] [![Coverage][coverage-badge]][coverage-link] [![MIT License][license-badge]](LICENSE.md) Magnificent app which corrects your previous console command, inspired by a [@liamosaur](https://twitter.com/liamosaur/) [tweet](https://twitter.com/liamosaur/status/506975850596536320). [![gif with examples][examples-link]][examples-link] Few more examples: ```bash ➜ apt-get install vim E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) E: Unable to lock the administration directory (/var/lib/dpkg/), are you root? ➜ fuck sudo apt-get install vim [enter/↑/↓/ctrl+c] [sudo] password for nvbn: Reading package lists... Done ... ``` ```bash ➜ git push fatal: The current branch master has no upstream branch. To push the current branch and set the remote as upstream, use git push --set-upstream origin master ➜ fuck git push --set-upstream origin master [enter/↑/↓/ctrl+c] Counting objects: 9, done. ... ``` ```bash ➜ puthon No command 'puthon' found, did you mean: Command 'python' from package 'python-minimal' (main) Command 'python' from package 'python3' (main) zsh: command not found: puthon ➜ fuck python [enter/↑/↓/ctrl+c] Python 3.4.2 (default, Oct 8 2014, 13:08:17) ... ``` ```bash ➜ git brnch git: 'brnch' is not a git command. See 'git --help'. Did you mean this? branch ➜ fuck git branch [enter/↑/↓/ctrl+c] * master ``` ```bash ➜ lein rpl 'rpl' is not a task. See 'lein help'. Did you mean this? repl ➜ fuck lein repl [enter/↑/↓/ctrl+c] nREPL server started on port 54848 on host 127.0.0.1 - nrepl://127.0.0.1:54848 REPL-y 0.3.1 ... ``` If you are not scared to blindly run the changed command, there is a `require_confirmation` [settings](#settings) option: ```bash ➜ apt-get install vim E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) E: Unable to lock the administration directory (/var/lib/dpkg/), are you root? ➜ fuck sudo apt-get install vim [sudo] password for nvbn: Reading package lists... Done ... ``` ## Requirements - python (2.7+ or 3.3+) - pip - python-dev ## Installation On OS X you can install `The Fuck` with [Homebrew][homebrew]: ```bash brew install thefuck ``` On Ubuntu you can install `The Fuck` with: ```bash sudo apt update sudo apt install python3-dev python3-pip sudo -H pip3 install thefuck ``` On other systems you can install `The Fuck` with `pip`: ```bash sudo -H pip install thefuck ``` [Or using an OS package manager (OS X, Ubuntu, Arch).](https://github.com/nvbn/thefuck/wiki/Installation) You should place this command in your `.bash_profile`, `.bashrc`, `.zshrc` or other startup script: ```bash eval "$(thefuck --alias)" # You can use whatever you want as an alias, like for Mondays: eval "$(thefuck --alias FUCK)" ``` [Or in your shell config (Bash, Zsh, Fish, Powershell, tcsh).](https://github.com/nvbn/thefuck/wiki/Shell-aliases) Changes will be available only in a new shell session. To make them available immediately, run `source ~/.bashrc` (or your shell config file like `.zshrc`). ## Update ```bash sudo pip install thefuck --upgrade ``` **Aliases changed in 1.34.** ## How it works The Fuck tries to match a rule for the previous command, creates a new command using the matched rule and runs it. Rules enabled by default are as follows: * `cargo` – runs `cargo build` instead of `cargo`; * `cargo_no_command` – fixes wrongs commands like `cargo buid`; * `cd_correction` – spellchecks and correct failed cd commands; * `cd_mkdir` – creates directories before cd'ing into them; * `cd_parent` – changes `cd..` to `cd ..`; * `chmod_x` – add execution bit; * `composer_not_command` – fixes composer command name; * `cp_omitting_directory` – adds `-a` when you `cp` directory; * `cpp11` – adds missing `-std=c++11` to `g++` or `clang++`; * `dirty_untar` – fixes `tar x` command that untarred in the current directory; * `dirty_unzip` – fixes `unzip` command that unzipped in the current directory; * `django_south_ghost` – adds `--delete-ghost-migrations` to failed because ghosts django south migration; * `django_south_merge` – adds `--merge` to inconsistent django south migration; * `docker_not_command` – fixes wrong docker commands like `docker tags`; * `dry` – fixes repetitions like `git git push`; * `fab_command_not_found` – fix misspelled fabric commands; * `fix_alt_space` – replaces Alt+Space with Space character; * `fix_file` – opens a file with an error in your `$EDITOR`; * `git_add` – fixes *"pathspec 'foo' did not match any file(s) known to git."*; * `git_branch_delete` – changes `git branch -d` to `git branch -D`; * `git_branch_exists` – offers `git branch -d foo`, `git branch -D foo` or `git checkout foo` when creating a branch that already exists; * `git_branch_list` – catches `git branch list` in place of `git branch` and removes created branch; * `git_checkout` – fixes branch name or creates new branch; * `git_diff_staged` – adds `--staged` to previous `git diff` with unexpected output; * `git_fix_stash` – fixes `git stash` commands (misspelled subcommand and missing `save`); * `git_help_aliased` – fixes `git help ` commands replacing with the aliased command; * `git_not_command` – fixes wrong git commands like `git brnch`; * `git_pull` – sets upstream before executing previous `git pull`; * `git_pull_clone` – clones instead of pulling when the repo does not exist; * `git_push` – adds `--set-upstream origin $branch` to previous failed `git push`; * `git_push_pull` – runs `git pull` when `push` was rejected; * `git_rebase_no_changes` – runs `git rebase --skip` instead of `git rebase --continue` when there are no changes; * `git_rm_recursive` – adds `-r` when you try to `rm` a directory; * `git_remote_seturl_add` – runs `git remote add` when `git remote set_url` on nonexistant remote; * `git_stash` – stashes you local modifications before rebasing or switching branch; * `git_two_dashes` – adds a missing dash to commands like `git commit -amend` or `git rebase -continue`; * `go_run` – appends `.go` extension when compiling/running Go programs; * `gradle_no_task` – fixes not found or ambiguous `gradle` task; * `gradle_wrapper` – replaces `gradle` with `./gradlew`; * `grep_arguments_order` – fixes grep arguments order for situations like `grep -lir . test`; * `grep_recursive` – adds `-r` when you trying to `grep` directory; * `grunt_task_not_found` – fixes misspelled `grunt` commands; * `gulp_not_task` – fixes misspelled `gulp` tasks; * `has_exists_script` – prepends `./` when script/binary exists; * `heroku_not_command` – fixes wrong `heroku` commands like `heroku log`; * `history` – tries to replace command with most similar command from history; * `java` – removes `.java` extension when running Java programs; * `javac` – appends missing `.java` when compiling Java files; * `lein_not_task` – fixes wrong `lein` tasks like `lein rpl`; * `ln_no_hard_link` – catches hard link creation on directories, suggest symbolic link; * `ln_s_order` – fixes `ln -s` arguments order; * `ls_lah` – adds `-lah` to `ls`; * `man` – changes manual section; * `man_no_space` – fixes man commands without spaces, for example `mandiff`; * `mercurial` – fixes wrong `hg` commands; * `mkdir_p` – adds `-p` when you trying to create directory without parent; * `mvn_no_command` – adds `clean package` to `mvn`; * `mvn_unknown_lifecycle_phase` – fixes misspelled lifecycle phases with `mvn`; * `npm_missing_script` – fixes `npm` custom script name in `npm run-script