mirror of
https://github.com/cheat/cheat.git
synced 2025-09-03 02:28:29 +02:00
Got a working version.
This commit is contained in:
48
cheat
Executable file
48
cheat
Executable file
@ -0,0 +1,48 @@
|
||||
#!/usr/bin/env python
|
||||
import sys
|
||||
|
||||
# Create a dictionary of cheat sheets
|
||||
cheats = {
|
||||
|
||||
'find' : '''
|
||||
''',
|
||||
|
||||
'git' : '''
|
||||
To set your identify:
|
||||
git config --global user.name "John Doe"
|
||||
git config --global user.email johndoe@example.com
|
||||
|
||||
To enable color:
|
||||
git config --global color.ui true
|
||||
''',
|
||||
|
||||
'ln' : '''
|
||||
To create a symlink:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
''',
|
||||
|
||||
'tar' : '''
|
||||
To extract an uncompressed archive:
|
||||
tar -xvf /path/to/foo.tar
|
||||
|
||||
To extract a gz archive:
|
||||
tar -xzvf /path/to/foo.tgz
|
||||
|
||||
To create a gz archive:
|
||||
tar -czvf /path/to/foo.tgz /path/to/foo/
|
||||
|
||||
To extract a bz2 archive:
|
||||
tar -xjvf /path/to/foo.tgz
|
||||
|
||||
To create a bz2 archive:
|
||||
tar -cjvf /path/to/foo.tgz /path/to/foo/
|
||||
''',
|
||||
|
||||
}
|
||||
|
||||
# Print the cheatsheet if it exists
|
||||
print cheats[sys.argv[1]] if sys.argv[1] in cheats.keys() else 'No cheatsheet found.'
|
Reference in New Issue
Block a user