Commit Graph
100 Commits
Author SHA1 Message Date
Chris Allen LaneandGitHub 4347114e19 Merge pull request #424 from JensKorte/patch-1
link changed, added details
2019-02-04 10:05:36 -05:00
Chris Lane edc67e7819 Updated links to README
Re-pathed links from `chrisallenlane/cheat` to `cheat/cheat` as
appropriate, following the move.
2019-02-04 10:03:19 -05:00
Chris Allen LaneandGitHub aa33a36491 Merge pull request #422 from cheat/refactor
Refactor
2019-02-04 09:58:24 -05:00
Chris Lane 9931b78c5f Lint
- Added instruction to lint `setup.py` to `ci/lint.sh`
- Updated `setup.py` per linter suggestions
2019-02-01 15:24:04 -05:00
Chris Lane a37577ee85 Trivial: docstrings
Updated some docstring comments.
2019-02-01 15:18:23 -05:00
Chris Lane 3ad923eff0 Refactored (11)
Renamed `CHEAT_DEFAULT_DIR` to `CHEAT_USER_DIR` because the latter more
accurately describes the purpose of the variable.
2019-02-01 15:10:03 -05:00
Chris Lane ba47dc2cbc Refactored (10)
- Added `ci/lint.sh`, which uses `flake8` to lint the relevant files
- Made changes to appease the linter.
- Bugfix in `cheat/configuration` (missing dependency)
2019-02-01 14:44:48 -05:00
Chris Lane df21731c02 Trivial Python style corrections 2019-02-01 11:43:38 -05:00
Chris Lane a657699a24 Refactored (9)
Moved some functionality into the `Util` class.
2019-02-01 11:43:11 -05:00
Chris Lane 5793c1845a Refactored (8)
Refactored `Sheet` class:

- Removed unnecessary indirection and extraneous methods
- Renamed some methods to conform to Pythonic conventions
- Renamed the `create_or_edit` method to `edit` to be consistent with
  subcommand name (`--edit`)
2019-02-01 11:23:38 -05:00
Chris Lane e2b5728283 Refactored (7)
Refactored for general code-clarity, with particular focus on removing
needless abstraction within `Sheet` and `Sheets` classes.
2019-01-31 20:03:56 -05:00
Chris Lane d61e4e7c34 Refactored (6)
Standardized (mostly) how the various classes are initialized.
2019-01-31 18:08:19 -05:00
Chris Lane 145a81dcd6 Var renames
Replaced more references to deprecated envvar names to their newer
counterparts.
2019-01-31 17:55:26 -05:00
Chris Lane 7c4fc54681 Refactored (5)
- Extracted `Colorize` class out of `Util` class. (The latter now only
  contains static methods.)
- Renamed methods in `Colorize` class for improved clarity.
- Refactored as necessary to accommodate the changes above.
2019-01-31 17:43:21 -05:00
Chris Lane 878d7e7e1b Refactored (4)
Improved handling of edge-cases in `configuration.py`.
2019-01-31 17:40:53 -05:00
Chris Lane 928637c9db Refactored (3)
Removed unnecessary `import` calls.
2019-01-31 17:14:21 -05:00
Chris Lane ab87bb11c4 Refactored (2)
Created an `Editor` class out methods in the `Util` class to enhance
code clarity.
2019-01-31 17:03:21 -05:00
Chris Lane 8f757d7735 Refactored (1)
Performed a general refactoring, focusing on the following:

- Removing layers of abstraction in config handling
- Stubbing out proper config validator
- Updating envvar names located throughout the project
2019-01-31 16:45:28 -05:00
Chris Lane c922ef4c8d Version bump: 2.4.2
Contains `termcolor` dependency fix.
2019-01-29 11:45:43 -05:00
Chris Allen LaneandGitHub 574a7ec3c9 Merge pull request #421 from chrisallenlane/termcolor
Added termcolor dependency to setup.py
2019-01-29 11:44:22 -05:00
Chris Lane 5ae49228b7 Added termcolor dependency to setup.py
Added a missing `termcolor` dependency to `install_requires` in
`setup.py`. `termcolors` was introduced as an optional dependency when
the `CHEAT_HIGHLIGHT` envvar was implemented.
2019-01-29 11:42:14 -05:00
Chris Lane 09acdf1a69 README edits
Updated the names of the (preferred) cheat-related environment
variables, which have been changed in recent versions.
2019-01-29 11:31:03 -05:00
Chris Lane 9ea60d12ff Version-bump to 2.4.1
- Includes various bugfixes regarding UTF-8 encoding
- Adds new cheatsheets
2019-01-29 10:58:57 -05:00
Chris Allen LaneandGitHub f7d747e101 Merge pull request #417 from butzel-net/master
suggestion for socat
2019-01-29 10:22:44 -05:00
Chris Lane 3b207b4d51 Merge branch 'dev' 2019-01-29 10:19:48 -05:00
Chris Allen LaneandGitHub 5e1d3abce8 Merge pull request #416 from chrisallenlane/issue-414-build-opts
Issue #414 - snap package compatibility
2019-01-29 10:18:55 -05:00
Chris Allen LaneandGitHub ad25e16dc6 Merge pull request #415 from chrisallenlane/issue-372
Addressing issue #372
2019-01-29 10:15:55 -05:00
Chris Allen LaneandGitHub 92c07c0137 Merge pull request #419 from chrisallenlane/issue-414-build-opts
Issue #414 - snap package compatibility
2019-01-27 14:50:37 -05:00
Chris Allen LaneandGitHub 7e35263e90 Merge pull request #418 from chrisallenlane/issue-372
Addressing issue #372
2019-01-27 14:45:41 -05:00
Chris Lane 1b6b5b79b7 Version bump: 2.4.0
Preparing a new `minor` release.
2019-01-27 14:36:57 -05:00
Chris Lane e319332138 Issue #414 - snap package compatibility
PR #391 changed the locaton into which system-wide cheatsheets are
installed to `/usr/share/cheat`, in order to comply with FHS. However,
this is causing conflicts with the `snap` packaging process.

This commit removes hard-coded references to `/usr/share/cheat` (outside
of `config/cheat`), and instead reads the cheat path via the
`CHEAT_PATH` config value (which may be set either in `cheat/config`, or
exported as an environment variable).

Lastly, this commit makes `setup.py` "aware of" the `CHEAT_PATH` env
var, allowing us to specify to where sytem-wide cheatsheets should be
installed during the `snap` build.
2019-01-21 12:58:03 -05:00
Chris Lane 13c0ea7525 Addressing issue #372
Previous pull-requests #406 and #413 attempted to resolve #372. They
were, however, never merged in.

Given that #391 was just merged (which rewrites a significant amount of
prior code), I here took what we learned from #406 and #413 and
re-implemented it. This approach will be less error-prone than
attempting to rebase either of the former on the changes introduced in
 #391.
2019-01-18 14:50:00 -05:00
Chris Lane 87448c49fa Merge branch 'TomasKorbar-changes' 2019-01-18 14:28:06 -05:00
Chris Allen LaneandGitHub 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
Chris Allen LaneandGitHub 2b58300d84 Merge pull request #404 from gorshkov/master
Fix url in curl cheatsheet
2019-01-11 14:20:18 -05:00
Chris Allen LaneandGitHub bf1be86fb9 Merge pull request #402 from FlorianKempenich/master
Add cheatsheet for `scd`
2019-01-11 14:19:22 -05:00
Chris Allen LaneandGitHub 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 LaneandGitHub ea7e71b002 Merge pull request #407 from idarlund/patch-2
Update ssh
2019-01-11 14:04:11 -05:00
Chris Allen LaneandGitHub d576eef13b Merge pull request #408 from idarlund/patch-3
Update scp
2019-01-11 14:03:31 -05:00
Chris Allen LaneandGitHub bec516b30a Merge pull request #409 from hutchison/master
Fixed a typo.
2019-01-11 14:02:39 -05:00
Chris Lane cccf37c284 Bumped the patch version number 2018-10-16 10:45:09 -04:00
Chris Allen LaneandGitHub 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
Chris Lane 8ec51d3194 v2.3.0
Version-bump to `v2.3.0`.
2018-10-15 10:51:11 -04:00
Chris Allen LaneandGitHub 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 LaneandGitHub 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 LaneandGitHub 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
Chris Allen LaneandGitHub 03fb44159a Merge pull request #394 from davidrea/patch-1
Add strikethrough to formatting
2018-09-17 09:33:35 -04:00
Chris Allen LaneandGitHub 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 LaneandGitHub 72f8c88394 Merge pull request #395 from eterps/patch-1
Added insert/add line examples
2018-09-17 09:31:43 -04:00
Chris Allen LaneandGitHub feab7a9706 Merge pull request #387 from idarlund/patch-1
Update rsync
2018-08-20 12:40:36 -04:00
Chris Allen LaneandGitHub a5b0132b08 Merge pull request #385 from dsalaj/master
Add cheatsheet slurm
2018-08-20 12:21:10 -04:00
Chris Allen LaneandGitHub ce1f4a099c Merge pull request #386 from navarroaxel/lsblk
Add cheatsheet for lsblk
2018-08-20 12:16:34 -04:00
Chris Allen LaneandGitHub 0e84cae79e Merge pull request #374 from bu6hunt3r/devel
Added sheet for r2 disassembler/debugger/hex editor
2018-08-20 12:14:16 -04:00
Chris Allen LaneandGitHub 93180c3852 Merge pull request #375 from shigemk2/zip
Added one more zip cheat
2018-08-20 11:50:27 -04:00
Chris Lane 795bcaffcb Merge branch 'master' of https://github.com/gigovich/cheat into gigovich-master 2018-08-20 11:40:34 -04:00
Chris Allen LaneandGitHub d6f12c4397 Merge pull request #373 from kevinawoo/patch-1
new cheat for mv: moving many files into a dir
2018-08-20 11:37:14 -04:00
Chris Allen LaneandGitHub 8ccc8bd546 Merge pull request #388 from pondrejk/patch-1
minor typo in nmcli command name
2018-08-20 10:48:43 -04:00
Chris Allen LaneandGitHub c29a3dfdc1 Merge pull request #368 from cedric-dufour/master
New Sheet Added: ZFS (on Linux)
2018-08-20 10:45:46 -04:00
Chris Lane aa1e12625e Version bump to 2.2.3. 2017-12-19 12:42:07 -05:00
Chris Allen LaneandGitHub d09353bfca Merge pull request #363 from shigemk2/shigemk2-patch-1
Add cheatsheet perl
2017-12-19 12:38:25 -05:00
Chris Allen LaneandGitHub 81e80c87a1 Merge pull request #358 from byxor/emacs
Add cheat for running emacs in terminal
2017-12-19 12:37:04 -05:00
Chris Allen LaneandGitHub 3d498d5ce7 Merge pull request #354 from rognan/add-cheat-for-youtube-dl-extract-audio
Add cheat for downloading audio with youtube-dl
2017-12-19 12:35:11 -05:00
Chris Allen LaneandGitHub d90d509702 Merge pull request #365 from shigemk2/check_function_mysql
Add cheatsheet for mysql
2017-12-19 12:34:05 -05:00
Chris Allen LaneandGitHub b46f5b2c34 Merge pull request #359 from Dgc2002/master
Adds cheatsheet for rcs
2017-12-19 12:33:01 -05:00
Chris Lane e2d63e7603 Minor edits to #357 2017-12-19 12:29:52 -05:00
Chris Lane 67f52f8317 Merge branch 'patch-1' of https://github.com/zrongh90/cheat into zrongh90-patch-1 2017-12-19 12:29:26 -05:00
Chris Allen LaneandGitHub 67134b9240 Merge pull request #360 from nitsnatsnok/patch-1
sizes and typo corrected
2017-12-19 12:27:29 -05:00
Chris Lane c67adb1422 Minor edits to #367. 2017-12-19 12:25:40 -05:00
Chris Lane c2aa5e0148 Merge branch 'master' of https://github.com/Sim4n6/cheat into Sim4n6-master 2017-12-19 12:24:19 -05:00
Chris Allen LaneandGitHub 332f0bd4ee Merge pull request #364 from navjotjsingh/master
Cheatsheet for cd
2017-12-19 12:21:37 -05:00
Chris Allen LaneandGitHub 2aa37432cb Merge pull request #356 from shigemk2/xargs-no-run-if-empty
Add cheatsheet for xargs --no-run-if-empty
2017-11-19 08:13:07 -05:00
Chris Allen LaneandGitHub 89de3705b0 Merge pull request #355 from shigemk2/curl-only-status-code
Add cheatsheet for cp backup file with date
2017-11-19 08:11:35 -05:00
Chris Lane d12718b8c4 cp edit
Appended missing newline to end of `cp` cheatsheet.
2017-11-19 08:09:37 -05:00
Chris Lane 900e083b99 Merge branch 'cp-backup' of git://github.com/shigemk2/cheat into shigemk2-cp-backup 2017-11-19 08:07:10 -05:00
Chris Lane d7272c50c4 v2.2.2
Added new cheatsheets.
2017-09-16 23:15:15 -04:00
Chris Allen LaneandGitHub cdf573a725 Merge pull request #318 from shanahanjrs/new-misc-cheatsheets
Created cheatsheets for alias, cat, cp, export, kill, mv, pwd, and wc
2017-09-16 23:01:08 -04:00
Chris Allen LaneandGitHub eb6dfaad39 Merge pull request #350 from iamatacos/patch-1
Update dd
2017-09-16 22:58:17 -04:00
Chris Lane d6dc39c687 v2.2.1
Version bump to 2.2.1. (Release contains new default cheatsheets.)
2017-09-05 14:23:10 -04:00
Chris Lane fb5ec798fa CONTRIBUTING.md
Made minor additions to the `CONTRIBUTING.md` file.
2017-09-05 13:48:06 -04:00
Chris Lane 866eb68d64 emacs cheatsheet
Minor whitespace edits on the emacs cheatsheet.
2017-09-05 13:26:23 -04:00
Chris Lane e17f60e4d5 Deleted accidental file
Deleted a file that seems to have been created accidentally. (It
contained nothing useful.)
2017-09-05 13:20:36 -04:00
Chris Lane ed2ef113f0 Merge branch 'emacs' of git://github.com/ndebuhr/cheat into ndebuhr-emacs 2017-09-05 13:19:19 -04:00
Chris Allen LaneandGitHub 432379d1e6 Merge pull request #336 from yafp/master
Adding a first version of a pkill cheatsheet
2017-09-04 20:06:23 -04:00
Chris Allen LaneandGitHub 7089bef7cc Merge pull request #337 from VHarisop/pip_latest
Updated pip sheet with upgrade for newer versions
2017-09-04 20:04:25 -04:00
Chris Lane aa57371819 Trivial whitespace changes to pgrep cheatsheet. 2017-09-04 20:01:25 -04:00
Chris Lane 921db35400 Merge branch 'pgrep' of git://github.com/shigemk2/cheat into shigemk2-pgrep 2017-09-04 20:00:38 -04:00
Chris Lane 852db958a4 Merge branch 'develop' 2017-09-04 19:57:28 -04:00
Chris Allen LaneandGitHub d58bbba1f8 Merge pull request #333 from npit/master
Update emacs cheatsheet
2017-09-04 19:55:33 -04:00
Chris Allen LaneandGitHub e5ffcf65e4 Merge pull request #328 from fpob/master
Add zsh cheatsheet
2017-09-04 19:54:49 -04:00