mirror of
https://github.com/cheat/cheat.git
synced 2025-12-13 02:32:05 +01:00
Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3b2848668a | ||
|
|
a8f91d4224 | ||
|
|
e0adbbc5b9 | ||
|
|
905f12a279 | ||
|
|
0c24bbbaaf | ||
|
|
baa782b8ce | ||
|
|
740358e4c0 | ||
|
|
2ebc8c9fac | ||
|
|
f3ecf76239 | ||
|
|
84df17a0f6 | ||
|
|
91c28712e6 | ||
|
|
8eda2266bc | ||
|
|
47fd7c90f4 | ||
|
|
4d57f529c9 | ||
|
|
5caa8fed38 | ||
|
|
69f91e0cf4 | ||
|
|
fdbc8909cc | ||
|
|
76a91ce358 |
@@ -31,14 +31,15 @@ Options:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
# require the dependencies
|
# require the dependencies
|
||||||
from cheat import *
|
import sheet
|
||||||
from cheat.utils import *
|
import sheets
|
||||||
|
from utils import *
|
||||||
from docopt import docopt
|
from docopt import docopt
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
def main():
|
||||||
# parse the command-line options
|
# parse the command-line options
|
||||||
options = docopt(__doc__, version='cheat 2.1.15')
|
options = docopt(__doc__, version='cheat 2.1.17')
|
||||||
|
|
||||||
# list directories
|
# list directories
|
||||||
if options['--directories']:
|
if options['--directories']:
|
||||||
@@ -59,3 +60,6 @@ if __name__ == '__main__':
|
|||||||
# print the cheatsheet
|
# print the cheatsheet
|
||||||
else:
|
else:
|
||||||
print(colorize(sheet.read(options['<cheatsheet>'])))
|
print(colorize(sheet.read(options['<cheatsheet>'])))
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
||||||
@@ -9,3 +9,9 @@ ls -lh
|
|||||||
|
|
||||||
# Display files, sorted by size
|
# Display files, sorted by size
|
||||||
ls -S
|
ls -S
|
||||||
|
|
||||||
|
# Display directories only
|
||||||
|
ls -d */
|
||||||
|
|
||||||
|
# Display directories only, include hidden
|
||||||
|
ls -d .*/ */
|
||||||
|
|||||||
@@ -12,3 +12,8 @@ CREATE DATABASE owa CHARACTER SET utf8 COLLATE utf8_general_ci;
|
|||||||
|
|
||||||
# To add a user and give rights on the given database
|
# To add a user and give rights on the given database
|
||||||
GRANT ALL PRIVILEGES ON database.* TO 'user'@'localhost'IDENTIFIED BY 'password' WITH GRANT OPTION;
|
GRANT ALL PRIVILEGES ON database.* TO 'user'@'localhost'IDENTIFIED BY 'password' WITH GRANT OPTION;
|
||||||
|
|
||||||
|
# To list the privileges granted to the account that you are using to connect to the server. Any of the 3 statements will work.
|
||||||
|
SHOW GRANTS FOR CURRENT_USER();
|
||||||
|
SHOW GRANTS;
|
||||||
|
SHOW GRANTS FOR CURRENT_USER;
|
||||||
|
|||||||
22
cheat/cheatsheets/tr
Normal file
22
cheat/cheatsheets/tr
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
#replace : with new line
|
||||||
|
echo $PATH|tr ":" "\n" #equivalent with:
|
||||||
|
echo $PATH|tr -t ":" \n
|
||||||
|
|
||||||
|
#remove all occurance of "ab"
|
||||||
|
echo aabbcc |tr -d "ab"
|
||||||
|
#ouput: cc
|
||||||
|
|
||||||
|
#complement "aa"
|
||||||
|
echo aabbccd |tr -c "aa" 1
|
||||||
|
#output: aa11111 without new line
|
||||||
|
#tip: Complement meaning keep aa,all others are replaced with 1
|
||||||
|
|
||||||
|
#complement "ab\n"
|
||||||
|
echo aabbccd |tr -c "ab\n" 1
|
||||||
|
#output: aabb111 with new line
|
||||||
|
|
||||||
|
#Preserve all alpha(-c). ":-[:digit:] etc" will be translated to "\n". sequeeze mode.
|
||||||
|
echo $PATH|tr -cs "[:alpha:]" "\n"
|
||||||
|
|
||||||
|
#ordered list to unordered list
|
||||||
|
echo "1. /usr/bin\n2. /bin" |tr -cs " /[:alpha:]\n" "+"
|
||||||
46
setup.py
46
setup.py
@@ -1,26 +1,32 @@
|
|||||||
from distutils.core import setup
|
"""cheat
|
||||||
import os
|
~~~~~~~~
|
||||||
|
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.
|
||||||
|
:license: GPL3
|
||||||
|
"""
|
||||||
|
|
||||||
|
from setuptools import setup, find_packages
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name = 'cheat',
|
name = 'cheat',
|
||||||
version = '2.1.15',
|
version = '2.1.17',
|
||||||
author = 'Chris Lane',
|
author = 'Chris Lane',
|
||||||
author_email = 'chris@chris-allen-lane.com',
|
author_email = 'chris@chris-allen-lane.com',
|
||||||
license = 'GPL3',
|
license = 'GPL3',
|
||||||
description = 'cheat allows you to create and view interactive cheatsheets '
|
description = 'cheat allows you to create and view interactive cheatsheets on the command-line',
|
||||||
'on the command-line. It was designed to help remind *nix system '
|
long_description = __doc__,
|
||||||
'administrators of options for commands that they use frequently, but not '
|
url = 'https://github.com/chrisallenlane/cheat',
|
||||||
'frequently enough to remember.',
|
packages = find_packages(),
|
||||||
url = 'https://github.com/chrisallenlane/cheat',
|
package_data = {
|
||||||
packages = [
|
'cheat.cheatsheets': ['*'],
|
||||||
'cheat',
|
},
|
||||||
'cheat.cheatsheets',
|
entry_points = {
|
||||||
'cheat.test',
|
'console_scripts': [
|
||||||
],
|
'cheat = cheat.app:main',
|
||||||
package_data = {
|
],
|
||||||
'cheat.cheatsheets': [f for f in os.listdir('cheat/cheatsheets') if '.' not in f]
|
|
||||||
},
|
},
|
||||||
scripts = ['bin/cheat'],
|
|
||||||
install_requires = [
|
install_requires = [
|
||||||
'docopt >= 0.6.1',
|
'docopt >= 0.6.1',
|
||||||
'pygments >= 1.6.0',
|
'pygments >= 1.6.0',
|
||||||
|
|||||||
Reference in New Issue
Block a user