GitHub Issues v0.1.10 GitHub.Issues.CLI
Handles the command line parsing and the dispatch to the various functions that end up generating a table of the first or last n issues of a GitHub project.
Summary
Types
parsed()
parsed :: {String.t, String.t, integer, boolean, IO.ANSI.Table.Style.t, IO.ANSI.Table.Formatter.column_width} | :help
Functions
Parses the command line arguments
.
argv
can be -h
or --help
, which returns :help
. Otherwise
it is a GitHub user name, project name, and optionally the number
of issues to format (the first n ones). To format the last n
issues, specify switch --last
which will return a negative count.
Returns either a tuple of
{user, project, count, bell, table_style, max_width}
or :help
if --help
was given.
Parameters
argv
- command line arguments (list)
Switches
-h
or--help
- for help-l
or--last
- to format the last n issues-b
or--bell
- to ring the bell-t
or--table-style
- to apply a specific table style-m
or--max-width
- to cap column widths
Table styles
light
- light colorslight-alt
- light colors, alternating row colorslight-mult
- light colors, 3 repeating row colorsmedium
- medium colorsmedium-alt
- medium colors, alternating row colorsmedium-mult
- medium colors, 3 repeating row colorsdark
- dark colorsdark-alt
- dark colors, alternating row colorsdark-mult
- dark colors, 3 repeating row colorspretty
- multicoloredpretty-alt
- multicolored, alternating row colorspretty-mult
- multicolored, 3 repeating row colorscyan
- light cyan backgroundyellow
- light yellow backgroundgreen
- light green backgroundCYAN
- light cyan borderYELLOW
- light yellow borderGREEN
- light green bordermixed
- fillers revealeddotted
- slightly coloreddotted-alt
- slightly colored, alternating row colorsdotted-mult
- slightly colored, 3 repeating row colorsdashed
- no colorsplain
- slightly coloredtest
- no colorsbare
- no colorsbarish
- like bare but coloredgreen-padded
- like green but with extra paddinggreen-unpadded
- like green but without paddingGREEN-PADDED
- like GREEN but with extra paddingGREEN-UNPADDED
- like GREEN but without paddingblue-alt
- blue header, alternating row colorsblue-mult
- blue header, 3 repeating row colorsgreen-alt
- green header, alternating row colorsgreen-mult
- green header, 3 repeating row colors
Examples
iex> alias GitHub.Issues.CLI
iex> CLI.parse(["-h"])
:help
iex> alias GitHub.Issues.CLI
iex> CLI.parse(["user", "project", "99"])
{"user", "project", 99, false, :medium, 88}
iex> alias GitHub.Issues.CLI
iex> CLI.parse(["user", "project", "88", "--last", "--bell"])
{"user", "project", -88, true, :medium, 88}
iex> alias GitHub.Issues.CLI
iex> CLI.parse(["user", "project", "6", "--table-style", "dark"])
{"user", "project", 6, false, :dark, 88}