mirror of
https://github.com/cheat/cheat.git
synced 2025-12-15 03:32:06 +01:00
Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7209f2c929 | ||
|
|
068d117bef | ||
|
|
9ead66461d | ||
|
|
d00bd87dd1 | ||
|
|
dd8b20a17a | ||
|
|
84e42e7f2f | ||
|
|
a59e91ead7 | ||
|
|
f495a4dfd9 | ||
|
|
10dd0e9a8b | ||
|
|
d06e5bab6f | ||
|
|
75b2555710 | ||
|
|
632da2024a | ||
|
|
1baa6d39c0 | ||
|
|
8f2912e5da | ||
|
|
3139796524 | ||
|
|
bcd4563bf3 | ||
|
|
5cd5387a47 | ||
|
|
c8f0e6295b | ||
|
|
31e442d7f9 | ||
|
|
352a760561 | ||
|
|
6be87e2d42 |
30
bin/cheat
30
bin/cheat
@@ -2,6 +2,8 @@
|
||||
|
||||
"""cheat
|
||||
|
||||
Create and view cheatsheets on the command line.
|
||||
|
||||
Usage:
|
||||
cheat <cheatsheet>
|
||||
cheat -e <cheatsheet>
|
||||
@@ -10,24 +12,26 @@ Usage:
|
||||
cheat -d
|
||||
cheat -v
|
||||
|
||||
cheat allows you to create and view interactive cheatsheets on the
|
||||
command-line. It was designed to help remind *nix system
|
||||
administrators of options for commands that they use frequently,
|
||||
but not frequently enough to remember.
|
||||
|
||||
Examples:
|
||||
To look up 'tar':
|
||||
cheat tar
|
||||
|
||||
To create or edit the cheatsheet for 'foo':
|
||||
cheat -e foo
|
||||
|
||||
Options:
|
||||
-d --directories List directories on CHEATPATH
|
||||
-e --edit Edit cheatsheet
|
||||
-l --list List cheatsheets
|
||||
-s --search Search cheatsheets for <keyword>
|
||||
-v --version Print the version number
|
||||
|
||||
Examples:
|
||||
|
||||
To view the `tar` cheatsheet:
|
||||
cheat tar
|
||||
|
||||
To edit (or create) the `foo` cheatsheet:
|
||||
cheat -e foo
|
||||
|
||||
To list all available cheatsheets:
|
||||
cheat -l
|
||||
|
||||
To search for "ssh" among all cheatsheets:
|
||||
cheat -s ssh
|
||||
"""
|
||||
|
||||
# require the dependencies
|
||||
@@ -38,7 +42,7 @@ from docopt import docopt
|
||||
|
||||
if __name__ == '__main__':
|
||||
# parse the command-line options
|
||||
options = docopt(__doc__, version='cheat 2.1.27')
|
||||
options = docopt(__doc__, version='cheat 2.1.28')
|
||||
|
||||
# list directories
|
||||
if options['--directories']:
|
||||
|
||||
@@ -11,7 +11,7 @@ u update
|
||||
x extract with full paths
|
||||
|
||||
Example:
|
||||
7z a -t7z -m0-lzma -mx=9 -mfb=64 -md=32m -ms=on archive.7z dir1
|
||||
7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on archive.7z dir1
|
||||
|
||||
-t7z 7z archive
|
||||
-m0=lzma lzma method
|
||||
|
||||
14
cheat/cheatsheets/cheat
Normal file
14
cheat/cheatsheets/cheat
Normal file
@@ -0,0 +1,14 @@
|
||||
# To see example usage of a program:
|
||||
cheat <command>
|
||||
|
||||
# To edit a cheatsheet
|
||||
cheat -e <command>
|
||||
|
||||
# To list available cheatsheets
|
||||
cheat -l
|
||||
|
||||
# To search available cheatsheets
|
||||
cheat -s <command>
|
||||
|
||||
# To get the current `cheat' version
|
||||
cheat -v
|
||||
20
cheat/cheatsheets/hg
Normal file
20
cheat/cheatsheets/hg
Normal file
@@ -0,0 +1,20 @@
|
||||
# Clone a directory
|
||||
hg clone
|
||||
|
||||
# Add files to hg tracker
|
||||
hg add filename
|
||||
|
||||
# Add all files in a folder to hg tracker
|
||||
hg add folder/
|
||||
|
||||
# Create a commit with all tracked changes and a message
|
||||
hg commit -m "message"
|
||||
|
||||
# Push commits to source repository
|
||||
hg push
|
||||
|
||||
# Pull changes from source repository
|
||||
hg pull
|
||||
|
||||
# Rebase local commits to disambiguate with remote repository
|
||||
hg pull --rebase
|
||||
2
cheat/cheatsheets/popd
Normal file
2
cheat/cheatsheets/popd
Normal file
@@ -0,0 +1,2 @@
|
||||
# Returns to the directory at the top of the `pushd' stack
|
||||
popd
|
||||
5
cheat/cheatsheets/pushd
Normal file
5
cheat/cheatsheets/pushd
Normal file
@@ -0,0 +1,5 @@
|
||||
# Pushes your current directory to the top of a stack while changing to the specified directory
|
||||
pushd <directory>
|
||||
|
||||
# To return use popd
|
||||
popd
|
||||
8
cheat/cheatsheets/shutdown
Normal file
8
cheat/cheatsheets/shutdown
Normal file
@@ -0,0 +1,8 @@
|
||||
# Reboot the system immediately
|
||||
shutdown -r now
|
||||
|
||||
# Shut system down immediately
|
||||
shutdown -h now
|
||||
|
||||
# Reboot system after 5 minutes
|
||||
shutdown -r +5
|
||||
2
cheat/cheatsheets/su
Normal file
2
cheat/cheatsheets/su
Normal file
@@ -0,0 +1,2 @@
|
||||
# Switch to another user account
|
||||
su USERNAME
|
||||
Reference in New Issue
Block a user