Commit Graph

64 Commits

Author SHA1 Message Date
Vladimir Iakovlev 14a9cd85aa #611: Allow to configure alias automatically by calling fuck twice 2017-03-13 21:50:13 +01:00
Vladimir Iakovlev 2379573cf2 #591: Add path_from_history rule 2017-03-13 19:05:34 +01:00
Joseph Frazier e009f0a05b Fix flake8 errors: E305 expected 2 blank lines after class or function definition 2017-03-08 19:53:54 -05:00
Andrew Epstein 778f2bdf1a Improve performance of history rule 2017-02-22 07:56:40 -05:00
Vladimir Iakovlev 5b535077bf #N/A: Stop changing Command inside rules 2016-10-08 12:18:33 +02:00
Vladimir Iakovlev 621b455334 #N/A: Monkeypatch pathlib on windows 2016-08-14 15:15:03 +03:00
Vladimir Iakovlev 176924c18d #N/A: Move imports from pathlib/pathlib2 to utils 2016-08-14 15:01:00 +03:00
Vladimir Iakovlev 46cb87615e #N/A: Remove old-style rules support 2016-08-14 14:37:32 +03:00
Alessio Sergi ebf1ea88f5 Switch from pathlib to pathlib2
The pathlib backport module is no longer maintained. The development
has moved to the pathlib2 module instead.

Quoting from the pathlib's README:
"Attention: this backport module isn't maintained anymore. If you want
to report issues or contribute patches, please consider the pathlib2
project instead."
2016-05-12 17:17:17 +02:00
Pablo Santiago Blum de Aguiar 561eb12c08 #504: UTF8-decode bin names if on Python 2
Fix #504
2016-05-11 13:31:57 -03:00
nvbn 251b69b5a0 #475: Try to use already used executable in no_command 2016-03-13 15:10:37 +03:00
Pablo Santiago Blum de Aguiar d8de5cfd20 #439 & #447: Remove cache if created with unavailable db
When switching between Python versions, the database package used to
create the cache might be unavailable and an ImportError is raised,
such as `ImportError: No module named gdbm`.
2016-03-08 14:38:16 -03:00
Pablo Santiago Blum de Aguiar 3cc4940842 #439 #447 Except anydbm instead of gdbm for PY2
Fix #439 and close #447
2016-02-14 00:43:07 -02:00
nvbn bbfd53d718 #N/A: Use shutil.which when possible 2016-02-06 16:42:42 +03:00
nvbn fe07fcaa62 #441: Remove shells methods wrappers 2016-01-29 13:09:40 +03:00
nvbn a2ec5aa3ff #441: Move function for getting current alias to utils 2016-01-29 12:22:31 +03:00
Pablo Santiago Blum de Aguiar cb6f964a30 Fix cache problem when going from Python 3 to 2 2016-01-21 23:57:17 -02:00
makalaaneesh 4f9fb796c4 fixes #425. command had to be re escaped 2016-01-08 00:50:26 +05:30
mcarton c3ea2fd0c7 Fix cache problem when going from Python 2 to 3 2015-11-15 16:55:07 +01:00
Alessio Treglia 7f777213c5 Fix misinterpretation of the disabled flag
The old implementation was misinterpretating the disabled flag and
effectively applying memoization even when explicitly disabled.
The 'or' operator is a short-circuit one; namely, it evaluates the
second argument if and only if the first is False. Therefore the
following conditions caused unexpected side effects:

- memoize.disabled = True, key not yet memoized

  Having disabled the memoize function wrapper, the client expects
  that no memoization happens. Instead the execution enters the
  if clause and store the value into the 'memo' dictionary

- memoize.disabled = True, key memoized

  Having disabled the memoize function wrapper, the client expects
  that no memoization happens and the function will be evaluated
  anyway, whether or not its return value had already been stored in
  the 'memo' dictionary by a previous call. On the contrary, the last
  statement of wrapper() access the value stored by the last function
  execution.

This commit attempts to improve the function readability too.
2015-11-04 22:44:50 +00:00
nvbn f20311fa89 #392: Little refactoring 2015-10-29 00:13:59 +08:00
mcarton e71a3e0cdb Replace (almost) all instance of script.split 2015-10-28 16:43:24 +01:00
mcarton ecfc180280 Add shells.quote 2015-10-28 14:16:01 +01:00
mcarton dae58211ba Parse command line with shlex
I put that in shells so that weird shells might try to parse it
differently.
2015-10-28 14:01:14 +01:00
nvbn 346cb99217 #385 Little refactoring 2015-10-21 18:13:22 +08:00
mcarton 8f25c95f06 Use XDG_CACHE_HOME for cache 2015-10-16 17:33:52 +02:00
nvbn b8ce95ad68 Minor refactoring 2015-09-08 15:24:49 +03:00
nvbn 7339a97b90 #364 Make aliases cache persistent 2015-09-07 19:05:38 +03:00
nvbn df4d2cc88d ⚠️ Remove settings param from rules match, get_new_command and side_effect 2015-09-07 13:00:29 +03:00
nvbn 382eb8b86c Fix tests 2015-09-07 12:12:16 +03:00
nvbn 105d3d8137 Make settings a global singleton 2015-09-06 21:47:12 +03:00
nvbn dd0667ea8f #356 Ignore thefuck entry points 2015-09-06 13:37:48 +03:00
nvbn 9a02e821cd Fix python 2 support 2015-09-02 11:54:58 +03:00
nvbn 4129ff2717 #353 Cache aliases in a temporary file 2015-09-02 11:10:03 +03:00
mcarton 8b62959fe3 Merge branch 'master' of github.com:nvbn/thefuck into slow 2015-09-01 14:28:30 +02:00
nvbn ebe53f0d18 Use decorator library 2015-08-27 16:52:26 +03:00
nvbn f2a7364e8c #351 Speed-up mvn rules, pep8 fixes 2015-08-27 16:10:50 +03:00
nvbn 9103c1ffd5 Add is_app/for_app helpers 2015-08-27 16:08:29 +03:00
mcarton 27c14a44af Fix tests
Thanks to [scorphus] for his [help].

[scorphus]: https://github.com/scorphus
[help]: https://github.com/nvbn/thefuck/pull/352#issuecomment-135248982
2015-08-27 10:54:42 +02:00
mcarton 51f1f44162 Memoize thefuck.utils.which
It is used by some rules to determine if they should be enabled by
default and searches in the $PATH, which can be quiet slow.
2015-08-26 21:43:20 +02:00
nvbn b21c9ebb43 Move all app/os specific utils to specific package 2015-08-25 14:09:47 +03:00
nvbn 2e002f666b Move utility functions from archlinux to utils 2015-08-25 13:55:33 +03:00
mcarton 986bbb30a7 Create thefuck.archlinux 2015-08-13 18:07:24 +02:00
nvbn d6e80b7835 #298 Suggest more than one result in *_no_command rules 2015-07-29 16:09:26 +03:00
nvbn 4bc1cc7849 #298 Add support of list results in sudo_support 2015-07-29 15:40:21 +03:00
Pablo Santiago Blum de Aguiar 4e854a575e Move get_all_matched_commands over to utils 2015-07-27 22:29:02 -03:00
nvbn 469c5a60b0 #N/A Add replace_argument helper 2015-07-24 00:39:56 +03:00
mcarton 903abff77e Support hub as well as git in @git_support 2015-07-21 15:06:04 +02:00
nvbn dee018e792 #N/A Move get_all_executables (formerly get_all_callables) to utils 2015-07-20 21:04:49 +03:00
nvbn 4f5659caad #87 Add ability to fix branch names in git_checkout rule 2015-07-20 19:25:29 +03:00