mirror of
				https://github.com/nvbn/thefuck.git
				synced 2025-10-30 06:34:09 +00:00 
			
		
		
		
	Merge pull request #150 from SanketDG/add-alias
Add thefuck-alias for outputting the alias command.
This commit is contained in:
		| @@ -110,6 +110,12 @@ alias fuck='eval $(thefuck $(fc -ln -1))' | ||||
| alias FUCK='fuck' | ||||
| ``` | ||||
|  | ||||
| Alternatively, you can redirect the output of `thefuck-alias`: | ||||
|  | ||||
| ```bash | ||||
| thefuck-alias >> ~/.bashrc | ||||
| ``` | ||||
|  | ||||
| [Or in your shell config (Bash, Zsh, Fish, Powershell).](https://github.com/nvbn/thefuck/wiki/Shell-aliases) | ||||
|  | ||||
| Changes will be available only in a new shell session. | ||||
| @@ -200,7 +206,7 @@ Or via environment variables: | ||||
| * `THEFUCK_REQUIRE_CONFIRMATION` – require confirmation before running new command, `true/false`; | ||||
| * `THEFUCK_WAIT_COMMAND` – max amount of time in seconds for getting previous command output; | ||||
| * `THEFUCK_NO_COLORS` – disable colored output, `true/false`. | ||||
|   | ||||
|  | ||||
| For example: | ||||
|  | ||||
| ```bash | ||||
|   | ||||
							
								
								
									
										2
									
								
								setup.py
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								setup.py
									
									
									
									
									
								
							| @@ -17,4 +17,4 @@ setup(name='thefuck', | ||||
|       zip_safe=False, | ||||
|       install_requires=['pathlib', 'psutil', 'colorama', 'six'], | ||||
|       entry_points={'console_scripts': [ | ||||
|           'thefuck = thefuck.main:main']}) | ||||
|           'thefuck = thefuck.main:main', 'thefuck-alias = thefuck.main:alias']}) | ||||
|   | ||||
| @@ -112,6 +112,10 @@ def is_second_run(command): | ||||
|     return command.script.startswith('fuck') | ||||
|  | ||||
|  | ||||
| def alias(): | ||||
|     print("\nalias fuck='eval $(thefuck $(fc -ln -1))'\n") | ||||
|  | ||||
|  | ||||
| def main(): | ||||
|     colorama.init() | ||||
|     user_dir = setup_user_dir() | ||||
|   | ||||
		Reference in New Issue
	
	Block a user