Tomas Korbar
4d19505b79
Conform code to pep8
2019-01-15 19:38:24 +01:00
Tomas Korbar
a2e028fd19
Move validation of CHEAT_HIGHLIGHT value to Configuration class
...
Method _check_configuration should be used for validating all bad
values from now on
2019-01-15 19:21:33 +01:00
Tomas Korbar
5eec6bf040
Improve handling of settings
...
Constructors of classes which need direct access to configuration
now take Config class instance as parameter which will give them
better maintainability in the future
CHEAT_HIGHLIGHT has been added to Configuration class
2019-01-15 19:13:30 +01:00
Tomas Korbar
3a4c2a887d
Add ConfigurationTestCase
...
- tests prove descending hiearchy of config system
- env vars, local config file, global config file
2019-01-15 17:09:39 +01:00
Tomas Korbar
879a58b721
Read env vars for global and local config path
...
- allows to change these paths for testing purposes and also
gives user option to change his config paths
2019-01-15 17:09:39 +01:00
Tomas Korbar
7814de96d2
Add classes for better readability
2019-01-15 17:09:39 +01:00
Tomas Korbar
a651426075
Add reading settings from configuration file
2019-01-15 17:09:35 +01:00
Tomas Korbar
c4c935a6a5
Change default location of cheatsheets
2019-01-15 16:48:07 +01:00
Chris Allen Lane
df86142b8e
Merge pull request #411 from chrisallenlane/snap-cheatsheet
...
Created a `snap` cheatsheet
2019-01-11 17:19:08 -05:00
Chris Lane
60b05c8781
Created a snap
cheatsheet
2019-01-11 17:18:02 -05:00
Chris Lane
22b64d2d08
Merge branch 'master' of https://github.com/liuyang1/cheat into liuyang1-master
...
Resolving merge-conflicts.
2019-01-11 17:00:39 -05:00
Chris Lane
1224908445
README edits
...
Updated the README to mention the new `CHEAT_HIGHLIGHT` environment
variable.
2019-01-11 16:36:17 -05:00
Chris Lane
28a2902e20
Implemented validation on CHEAT_HIGHLIGHT
...
Implemnted an assertion that `CHEAT_HIGHLIGHT` (if set) contains a value
that is acceptible to `termcolors`. This happens only once, upon the
invokation of `__main__`. If the assertion fails, `cheat` terminates
with an exit code of `1`.
2019-01-11 16:26:57 -05:00
Chris Lane
730c488854
Introduced CHEAT_HIGHLIGHT
...
Introduced CHEAT_HIGHLIGHT environment variable to de-couple search-term
highlighting from syntax highlighting.
2019-01-11 16:13:38 -05:00
Chris Lane
ba9051e3cd
highlight
bug-fix
...
Fixed a bug in `cheat/utils.py` that would cause `highlight` to return
the wrong value when `CHEATCOLORS` was not set.
2019-01-11 15:58:21 -05:00
Chris Lane
7c7278ac8b
Util logic simplification
...
- Simplified the logic regarding checking the state of `CHEATCOLORS` in
`cheat/utils.py`
- Improved the commenting within the same
2019-01-11 15:54:20 -05:00
Chris Lane
e1fdca231e
Merged #353 with changes
...
PR #353 implemented highlighting on search terms within search results.
This PR:
- Merges the above
- Makes a few modifications upon the implementation
Specifically, the new implementation no longer relies on hard-coded
escape-sequences. Instead, a new `highlight` function has been created,
which in turn attempts to defer to the `termcolors` library to colorize
the necessary text.
2019-01-11 15:46:54 -05:00
Chris Lane
6b796adaf7
README edit
...
Edited the addition regarding Pygments.
2019-01-11 15:13:41 -05:00
Joaquin Garmendia Cabrera
95843e4674
Updating dependencies to highlighting
2019-01-11 15:10:39 -05:00
Chris Allen Lane
2b58300d84
Merge pull request #404 from gorshkov/master
...
Fix url in curl cheatsheet
2019-01-11 14:20:18 -05:00
Chris Allen Lane
bf1be86fb9
Merge pull request #402 from FlorianKempenich/master
...
Add cheatsheet for `scd`
2019-01-11 14:19:22 -05:00
Chris Allen Lane
35c4a8d639
Merge pull request #403 from sundar-raman/master
...
Disable colorized output when CHEATCOLORS is not "true", or not set
2019-01-11 14:13:21 -05:00
Chris Lane
6910adae90
Merge branch 'master' of github.com:chrisallenlane/cheat
2019-01-11 14:05:55 -05:00
Chris Lane
b47b4bc1d1
Modified .gitignore
...
Added `.env` to the list of ignored files.
2019-01-11 14:05:38 -05:00
Chris Allen Lane
ea7e71b002
Merge pull request #407 from idarlund/patch-2
...
Update ssh
2019-01-11 14:04:11 -05:00
Chris Allen Lane
d576eef13b
Merge pull request #408 from idarlund/patch-3
...
Update scp
2019-01-11 14:03:31 -05:00
Chris Allen Lane
bec516b30a
Merge pull request #409 from hutchison/master
...
Fixed a typo.
2019-01-11 14:02:39 -05:00
Martin Darmüntzel
f0b3f8037b
Fixed a typo.
2019-01-09 15:47:49 +01:00
Idar Lund
3938032595
Update scp
...
scp over socks
2019-01-08 08:24:16 +01:00
Idar Lund
f35cfa084e
Update ssh
...
added ssh over socks tunnel
2019-01-08 08:19:09 +01:00
Evgeny
cdb22f310d
Fix url in curl cheatsheet
2018-12-19 21:11:54 +07:00
Sundar Raman
6d1eff16a1
Disable colorized output when CHEATCOLORS is not "true", or not set
2018-11-11 13:04:51 +08:00
Florian Kempenich
9241de04d6
Update formatting to adhere to the guideline.
2018-10-25 11:37:39 +01:00
Florian Kempenich
8ac1851a69
Add cheatsheet for scd
...
`scd` is a fantastic `oh-my-zsh` plugin to quickly jump between directories.
See here: https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/scd
2018-10-25 11:34:25 +01:00
Chris Lane
cccf37c284
Bumped the patch
version number
2018-10-16 10:45:09 -04:00
Chris Allen Lane
15f70c2cc3
Merge pull request #401 from tculp/case-insensitive-search
...
Added a .lower() call to line when searching
2018-10-16 10:43:30 -04:00
tculp
cebe3de389
Update sheets.py
...
Added a missing .lower() to the line
2018-10-15 12:21:52 -04:00
Chris Lane
8ec51d3194
v2.3.0
...
Version-bump to `v2.3.0`.
2018-10-15 10:51:11 -04:00
Chris Allen Lane
500dbbbd4a
Merge pull request #399 from tculp/case-insensitive-search
...
Changed search behavior to lower the search term and the lines being …
2018-10-15 10:44:57 -04:00
Chris Allen Lane
66ebae4ed5
Merge pull request #398 from ticky/patch-1
...
Add `tee /dev/tty` mid-pipeline example to tee
2018-10-09 11:22:43 -04:00
Chris Allen Lane
5a83a22888
Merge pull request #400 from dufferzafar/patch-1
...
Update pacman: command to view top recently installed packages
2018-10-09 11:19:47 -04:00
Shadab Zafar
62a2bf3c2d
Update pacman
2018-10-01 12:34:46 +05:30
Tyler Culp
4b6dc22c0a
Changed search behavior to lower the search term and the lines being searched, thus providing case-insensitive search
2018-09-20 13:53:22 -04:00
Jessica Stokes
cd46559250
Add tee /dev/tty
mid-pipeline example to tee
2018-09-19 17:53:19 -07:00
Chris Allen Lane
03fb44159a
Merge pull request #394 from davidrea/patch-1
...
Add strikethrough to formatting
2018-09-17 09:33:35 -04:00
Chris Allen Lane
f0bd3ba4e6
Merge pull request #393 from mirekfranc/for-loop-extended
...
for: add few more for examples, the last two are probably bash specific
2018-09-17 09:32:48 -04:00
Chris Allen Lane
72f8c88394
Merge pull request #395 from eterps/patch-1
...
Added insert/add line examples
2018-09-17 09:31:43 -04:00
Erik Terpstra
2fcc808e63
Added insert/add line examples
...
Added insert/add line examples.
2018-09-11 09:22:21 +02:00
Dave Rea
4aef22f457
Add strikethrough to formatting
...
(this is the one I always forget!)
2018-09-04 10:13:55 -04:00
Miroslav Franc
146b671412
add few more for examples, the last two are probably bash specific
2018-09-03 15:54:56 +02:00