mirror of
https://github.com/cheat/cheat.git
synced 2025-09-01 09:38:29 +02:00
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
417f47f037 | |||
f39fad1324 | |||
4cf03c5363 | |||
afcd74c8bf | |||
e27ce3f1f9 | |||
e9b8f04c24 |
@ -38,7 +38,7 @@ from docopt import docopt
|
||||
|
||||
if __name__ == '__main__':
|
||||
# parse the command-line options
|
||||
options = docopt(__doc__, version='cheat 2.1.6')
|
||||
options = docopt(__doc__, version='cheat 2.1.8')
|
||||
|
||||
# list directories
|
||||
if options['--directories']:
|
||||
|
15
cheat/cheatsheets/paste
Normal file
15
cheat/cheatsheets/paste
Normal file
@ -0,0 +1,15 @@
|
||||
# Concat columns from files
|
||||
paste file1 file2 ...
|
||||
|
||||
# List the files in the current directory in three columns:
|
||||
ls | paste - - -
|
||||
|
||||
# Combine pairs of lines from a file into single lines:
|
||||
paste -s -d '\t\n' myfile
|
||||
|
||||
# Number the lines in a file, similar to nl(1):
|
||||
sed = myfile | paste -s -d '\t\n' - -
|
||||
|
||||
# Create a colon-separated list of directories named bin,
|
||||
# suitable for use in the PATH environment variable:
|
||||
find / -name bin -type d | paste -s -d : -
|
@ -22,6 +22,9 @@ yum info <package name>
|
||||
# List currently enabled repositories:
|
||||
yum repolist
|
||||
|
||||
# List packages containing a certain keyword:
|
||||
yum list <package_name_or_word_to_search>
|
||||
|
||||
# To download the source RPM for a package:
|
||||
yumdownloader --source <package name>
|
||||
|
||||
|
@ -32,6 +32,10 @@ def create_or_edit(sheet):
|
||||
copy(path(sheet), os.path.join(sheets.default_path(), sheet))
|
||||
edit(sheet)
|
||||
|
||||
# if it exists and is in the default path, then just open it
|
||||
else:
|
||||
edit(sheet)
|
||||
|
||||
|
||||
def create(sheet):
|
||||
""" Creates a cheatsheet """
|
||||
|
Reference in New Issue
Block a user