GitHub Issues v0.1.0 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

Functions

Parses and processes the command line arguments

Parses the command line arguments

Types

parsed()
parsed ::
  {String.t, String.t, integer, boolean, atom} |
  :help

Functions

main(argv)
main([String.t]) :: :ok | no_return

Parses and processes the command line arguments.

Parameters

  • argv - command line arguments (list)
parse(argv)
parse([String.t]) :: parsed

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, style} 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

Table styles

  • light - light colors
  • light-alt - light colors, alternating row colors
  • light-mult - light colors, 3 repeating row colors
  • medium - medium colors
  • medium-alt - medium colors, alternating row colors
  • medium-mult - medium colors, 3 repeating row colors
  • dark - dark colors
  • dark-alt - dark colors, alternating row colors
  • dark-mult - dark colors, 3 repeating row colors
  • pretty - multicolored
  • pretty-alt - multicolored, alternating row colors
  • pretty-mult - multicolored, 3 repeating row colors
  • cyan - light cyan background
  • yellow - light yellow background
  • green - light green background
  • CYAN - light cyan border
  • YELLOW - light yellow border
  • GREEN - light green border
  • mixed - fillers revealed
  • dotted - slightly colored
  • dotted-alt - slightly colored, alternating row colors
  • dotted-mult - slightly colored, 3 repeating row colors
  • dashed - no colors
  • plain - slightly colored
  • test - no colors
  • bare - no colors
  • barish - like bare but colored
  • green-padded - like green but with extra padding
  • green-unpadded - like green but without padding
  • GREEN-PADDED - like GREEN but with extra padding
  • GREEN-UNPADDED - like GREEN but without padding
  • black-alt - black header, alternating row colors
  • black-mult - black header, 3 repeating row colors
  • green-alt - green header, alternating row colors
  • green-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}

iex> alias GitHub.Issues.CLI
iex> CLI.parse(["user", "project", "88", "--last", "--bell"])
{"user", "project", -88, true, :medium}

iex> alias GitHub.Issues.CLI
iex> CLI.parse(["user", "project", "6", "--table-style", "dark"])
{"user", "project", 6, false, :dark}