Exdoc CLI
A CLI equivilent to the IEx h/1 helper.
Installation
Install with mix escript.install hex exdoc_cli
Once installed, run exdoc <Module>
Examples
$ exdoc Enum
$ exdoc Enum.flat_map
$ exdoc Enum.reduce/2
View source code
To view the source code of the module, pass the --open
flag.
exdoc Enum.reduce/2 --open
This uses the $ELIXIR_EDITOR environment variable and falls back to $EDITOR if the former is not available. See IEx.Helpers.open/1 or just run exdoc IEx.Helpers.open/1
for more info on setting up your editor.
On my system, I use Alacritty as my terminal and Vim as my editor. I've setup a tiny little executable script called vimsh
that opens a terminal and starts vim with the specified file that looks like this:
#!/bin/bash
/usr/bin/alacritty -e vim $@
and my $ELIXIR_EDITOR variable is set as:
vimsh +__LINE__ __FILE__
License
GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007
Copyright (C) 2022 Matt Silbernagel
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.