This commit is contained in:
astrorigin 2022-11-10 09:12:45 +01:00 committed by GitHub
commit 471c9e7ab6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 93 additions and 142 deletions

View File

@ -1,182 +1,136 @@
.\" Automatically generated by Pandoc 2.2.1
.\" Automatically generated by Pandoc 2.9.2.1
.\"
.TH "CHEAT" "1" "" "" "General Commands Manual"
.hy
.SH NAME
.PP
\f[B]cheat\f[] \[em] create and view command\-line cheatsheets
\f[B]cheat\f[R] \[em] create and view command-line cheatsheets
.SH SYNOPSIS
.PP
\f[B]cheat\f[] [options] [\f[I]CHEATSHEET\f[]]
\f[B]cheat\f[R] [options] [\f[I]CHEATSHEET\f[R]]
.SH DESCRIPTION
.PP
\f[B]cheat\f[] allows you to create and view interactive cheatsheets on
the command\-line.
\f[B]cheat\f[R] 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.
.SH OPTIONS
.TP
.B \[en]init
--init
Print a config file to stdout.
.RS
.RE
.TP
.B \-c, \[en]colorize
-c, --colorize
Colorize output.
.RS
.RE
.TP
.B \-d, \[en]directories
-d, --directories
List cheatsheet directories.
.RS
.RE
.TP
.B \-e, \[en]edit=\f[I]CHEATSHEET\f[]
Open \f[I]CHEATSHEET\f[] for editing.
.RS
.RE
-e, --edit=\f[I]CHEATSHEET\f[R]
Open \f[I]CHEATSHEET\f[R] for editing.
.TP
.B \-l, \[en]list
-l, --list
List available cheatsheets.
.RS
.RE
.TP
.B \-p, \[en]path=\f[I]PATH\f[]
Filter only to sheets found on path \f[I]PATH\f[].
.RS
.RE
-p, --path=\f[I]PATH\f[R]
Filter only to sheets found on path \f[I]PATH\f[R].
.TP
.B \-r, \[en]regex
Treat search \f[I]PHRASE\f[] as a regular expression.
.RS
.RE
-r, --regex
Treat search \f[I]PHRASE\f[R] as a regular expression.
.TP
.B \-s, \[en]search=\f[I]PHRASE\f[]
Search cheatsheets for \f[I]PHRASE\f[].
.RS
.RE
-s, --search=\f[I]PHRASE\f[R]
Search cheatsheets for \f[I]PHRASE\f[R].
.TP
.B \-t, \[en]tag=\f[I]TAG\f[]
Filter only to sheets tagged with \f[I]TAG\f[].
.RS
.RE
-t, --tag=\f[I]TAG\f[R]
Filter only to sheets tagged with \f[I]TAG\f[R].
.TP
.B \-T, \[en]tags
-T, --tags
List all tags in use.
.RS
.RE
.TP
.B \-v, \[en]version
-v, --version
Print the version number.
.RS
.RE
.TP
.B \[en]rm=\f[I]CHEATSHEET\f[]
Remove (deletes) \f[I]CHEATSHEET\f[].
.RS
.RE
--rm=\f[I]CHEATSHEET\f[R]
Remove (deletes) \f[I]CHEATSHEET\f[R].
.SH EXAMPLES
.TP
.B To view the foo cheatsheet:
cheat \f[I]foo\f[]
.RS
.RE
To view the foo cheatsheet:
cheat \f[I]foo\f[R]
.TP
.B To edit (or create) the foo cheatsheet:
cheat \-e \f[I]foo\f[]
.RS
.RE
To edit (or create) the foo cheatsheet:
cheat -e \f[I]foo\f[R]
.TP
.B To edit (or create) the foo/bar cheatsheet on the `work' cheatpath:
cheat \-p \f[I]work\f[] \-e \f[I]foo/bar\f[]
.RS
.RE
To edit (or create) the foo/bar cheatsheet on the `work' cheatpath:
cheat -p \f[I]work\f[R] -e \f[I]foo/bar\f[R]
.TP
.B To view all cheatsheet directories:
cheat \-d
.RS
.RE
To view all cheatsheet directories:
cheat -d
.TP
.B To list all available cheatsheets:
cheat \-l
.RS
.RE
To list all available cheatsheets:
cheat -l
.TP
.B To list all cheatsheets whose titles match `apt':
cheat \-l \f[I]apt\f[]
.RS
.RE
To list all cheatsheets whose titles match `apt':
cheat -l \f[I]apt\f[R]
.TP
.B To list all tags in use:
cheat \-T
.RS
.RE
To list all tags in use:
cheat -T
.TP
.B To list available cheatsheets that are tagged as `personal':
cheat \-l \-t \f[I]personal\f[]
.RS
.RE
To list available cheatsheets that are tagged as `personal':
cheat -l -t \f[I]personal\f[R]
.TP
.B To search for `ssh' among all cheatsheets, and colorize matches:
cheat \-c \-s \f[I]ssh\f[]
.RS
.RE
To search for `ssh' among all cheatsheets, and colorize matches:
cheat -c -s \f[I]ssh\f[R]
.TP
.B To search (by regex) for cheatsheets that contain an IP address:
cheat \-c \-r \-s \f[I]`(?:[0\-9]{1,3}.){3}[0\-9]{1,3}'\f[]
.RS
.RE
To search (by regex) for cheatsheets that contain an IP address:
cheat -c -r -s \f[I]`(?:[0-9]{1,3}.){3}[0-9]{1,3}'\f[R]
.TP
.B To remove (delete) the foo/bar cheatsheet:
cheat \[en]rm \f[I]foo/bar\f[]
.RS
.RE
To remove (delete) the foo/bar cheatsheet:
cheat --rm \f[I]foo/bar\f[R]
.SH FILES
.SS Configuration
.PP
\f[B]cheat\f[] is configured via a YAML file that is conventionally
named \f[I]conf.yaml\f[].
\f[B]cheat\f[] will search for \f[I]conf.yaml\f[] in varying locations,
depending upon your platform:
\f[B]cheat\f[R] is configured via a YAML file that is conventionally
named \f[I]conf.yaml\f[R].
\f[B]cheat\f[R] will search for \f[I]conf.yaml\f[R] in varying
locations, depending upon your platform:
.SS Linux, OSX, and other Unixes
.IP "1." 3
\f[B]CHEAT_CONFIG_PATH\f[]
\f[B]CHEAT_CONFIG_PATH\f[R]
.IP "2." 3
\f[B]XDG_CONFIG_HOME\f[]/cheat/conf.yaml
\f[B]XDG_CONFIG_HOME\f[R]/cheat/conf.yaml
.IP "3." 3
\f[B]$HOME\f[]/.config/cheat/conf.yml
\f[B]$HOME\f[R]/.config/cheat/conf.yml
.IP "4." 3
\f[B]$HOME\f[]/.cheat/conf.yml
\f[B]$HOME\f[R]/.cheat/conf.yml
.SS Windows
.IP "1." 3
\f[B]CHEAT_CONFIG_PATH\f[]
\f[B]CHEAT_CONFIG_PATH\f[R]
.IP "2." 3
\f[B]APPDATA\f[]/cheat/conf.yml
\f[B]APPDATA\f[R]/cheat/conf.yml
.IP "3." 3
\f[B]PROGRAMDATA\f[]/cheat/conf.yml
\f[B]PROGRAMDATA\f[R]/cheat/conf.yml
.PP
\f[B]cheat\f[] will search in the order specified above.
The first \f[I]conf.yaml\f[] encountered will be respected.
\f[B]cheat\f[R] will search in the order specified above.
The first \f[I]conf.yaml\f[R] encountered will be respected.
.PP
If \f[B]cheat\f[] cannot locate a config file, it will ask if you'd like
to generate one automatically.
If \f[B]cheat\f[R] cannot locate a config file, it will ask if you\[cq]d
like to generate one automatically.
Alternatively, you may also generate a config file manually by running
\f[B]cheat \[en]init\f[] and saving its output to the appropriate
location for your platform.
\f[B]cheat --init\f[R] and saving its output to the appropriate location
for your platform.
.SS Cheatpaths
.PP
\f[B]cheat\f[] reads its cheatsheets from \[lq]cheatpaths\[rq], which
\f[B]cheat\f[R] reads its cheatsheets from \[lq]cheatpaths\[rq], which
are the directories in which cheatsheets are stored.
Cheatpaths may be configured in \f[I]conf.yaml\f[], and viewed via
\f[B]cheat \-d\f[].
Cheatpaths may be configured in \f[I]conf.yaml\f[R], and viewed via
\f[B]cheat -d\f[R].
.PP
For detailed instructions on how to configure cheatpaths, please refer
to the comments in conf.yml.
.SS Autocompletion
.PP
Autocompletion scripts for \f[B]bash\f[], \f[B]zsh\f[], and
\f[B]fish\f[] are available for download:
Autocompletion scripts for \f[B]bash\f[R], \f[B]zsh\f[R], and
\f[B]fish\f[R] are available for download:
.IP \[bu] 2
<https://github.com/cheat/cheat/blob/master/scripts/cheat.bash>
.IP \[bu] 2
@ -184,25 +138,22 @@ Autocompletion scripts for \f[B]bash\f[], \f[B]zsh\f[], and
.IP \[bu] 2
<https://github.com/cheat/cheat/blob/master/scripts/cheat.zsh>
.PP
The \f[B]bash\f[] and \f[B]zsh\f[] scripts provide optional integration
with \f[B]fzf\f[], if the latter is available on your \f[B]PATH\f[].
The \f[B]bash\f[R] and \f[B]zsh\f[R] scripts provide optional
integration with \f[B]fzf\f[R], if the latter is available on your
\f[B]PATH\f[R].
.PP
The installation process will vary per system and shell configuration,
and thus will not be discussed here.
.SH ENVIRONMENT
.TP
.B \f[B]CHEAT_CONFIG_PATH\f[]
\f[B]CHEAT_CONFIG_PATH\f[R]
The path at which the config file is available.
If \f[B]CHEAT_CONFIG_PATH\f[] is set, all other config paths will be
If \f[B]CHEAT_CONFIG_PATH\f[R] is set, all other config paths will be
ignored.
.RS
.RE
.TP
.B \f[B]CHEAT_USE_FZF\f[]
\f[B]CHEAT_USE_FZF\f[R]
If set, autocompletion scripts will attempt to integrate with
\f[B]fzf\f[].
.RS
.RE
\f[B]fzf\f[R].
.SH RETURN VALUES
.IP "0." 3
Successful termination
@ -218,4 +169,4 @@ See GitHub issues: <https://github.com/cheat/cheat/issues>
Christopher Allen Lane <chris@chris-allen-lane.com>
.SH SEE ALSO
.PP
\f[B]fzf(1)\f[]
\f[B]fzf(1)\f[R]

View File

@ -20,40 +20,40 @@ remember.
OPTIONS
=======
--init
\--init
: Print a config file to stdout.
-c, --colorize
-c, \--colorize
: Colorize output.
-d, --directories
-d, \--directories
: List cheatsheet directories.
-e, --edit=_CHEATSHEET_
-e, \--edit=_CHEATSHEET_
: Open _CHEATSHEET_ for editing.
-l, --list
-l, \--list
: List available cheatsheets.
-p, --path=_PATH_
-p, \--path=_PATH_
: Filter only to sheets found on path _PATH_.
-r, --regex
-r, \--regex
: Treat search _PHRASE_ as a regular expression.
-s, --search=_PHRASE_
-s, \--search=_PHRASE_
: Search cheatsheets for _PHRASE_.
-t, --tag=_TAG_
-t, \--tag=_TAG_
: Filter only to sheets tagged with _TAG_.
-T, --tags
-T, \--tags
: List all tags in use.
-v, --version
-v, \--version
: Print the version number.
--rm=_CHEATSHEET_
\--rm=_CHEATSHEET_
: Remove (deletes) _CHEATSHEET_.
@ -91,7 +91,7 @@ To search (by regex) for cheatsheets that contain an IP address:
: cheat -c -r -s _'(?:[0-9]{1,3}\.){3}[0-9]{1,3}'_
To remove (delete) the foo/bar cheatsheet:
: cheat --rm _foo/bar_
: cheat \--rm _foo/bar_
FILES
@ -100,13 +100,13 @@ FILES
Configuration
-------------
**cheat** is configured via a YAML file that is conventionally named
_conf.yaml_. **cheat** will search for _conf.yaml_ in varying locations,
_conf.yml_. **cheat** will search for _conf.yml_ in varying locations,
depending upon your platform:
### Linux, OSX, and other Unixes ###
1. **CHEAT_CONFIG_PATH**
2. **XDG_CONFIG_HOME**/cheat/conf.yaml
2. **XDG_CONFIG_HOME**/cheat/conf.yml
3. **$HOME**/.config/cheat/conf.yml
4. **$HOME**/.cheat/conf.yml
@ -116,19 +116,19 @@ depending upon your platform:
2. **APPDATA**/cheat/conf.yml
3. **PROGRAMDATA**/cheat/conf.yml
**cheat** will search in the order specified above. The first _conf.yaml_
**cheat** will search in the order specified above. The first _conf.yml_
encountered will be respected.
If **cheat** cannot locate a config file, it will ask if you'd like to generate
one automatically. Alternatively, you may also generate a config file manually
by running **cheat --init** and saving its output to the appropriate location
by running **cheat \--init** and saving its output to the appropriate location
for your platform.
Cheatpaths
----------
**cheat** reads its cheatsheets from "cheatpaths", which are the directories in
which cheatsheets are stored. Cheatpaths may be configured in _conf.yaml_, and
which cheatsheets are stored. Cheatpaths may be configured in _conf.yml_, and
viewed via **cheat -d**.
For detailed instructions on how to configure cheatpaths, please refer to the