NPM module: explain-command

npm install explain-command, then run “explain” on your command line.

Jackson Pauls By Jackson Pauls

Following on from our bash function to explain commands from the command line, here’s a new npm module with the same functionality:

[j@lianli ~]$ sudo npm install -g explain-command

Use it like so (user input in bold):

[j@lianli ~]$ explain ls -lA

ls(1)
  List information about the FILEs (the current directory by default). Sort
  entries alphabetically if none of -cftuvSUX nor --sort is specified.
  Mandatory arguments to long options are mandatory for short options too.

  -l
    use a long listing format

  -A (-A, --almost-all)
    do not list implied . and ..

Or interactively like so:

[j@lianli ~]$ explain
Command: grep -rsI

grep(1)
  grep searches the named input FILEs for lines containing a match to the given
  PATTERN. If no files are specified, or if the file “-” is given, grep
  searches standard input. By default, grep prints the matching lines. In
  addition, the variant programs egrep and fgrep are the same as grep -E and
  grep -F, respectively. These variants are deprecated, but are provided for
  backward compatibility.

  -r (-r, --recursive)
    Read all files under each directory, recursively, following symbolic links
    only if they are on the command line. Note that if no file operand is
    given, grep searches the working directory. This is equivalent to the -d
    recurse option.

  -s (-s, --no-messages)
    Suppress error messages about nonexistent or unreadable files.

  -I
    Process a binary file as if it did not contain matching data; this is
    equivalent to the --binary-files=without-match option.

Command: [return]
Bye!

The explain-command module is on npmjs.com and github.com.