@@ -12,7 +12,7 @@ defmodule ElixirScript.CommandLine do
12
12
@ moduledoc """
13
13
Struct for parsed args
14
14
"""
15
- defstruct debug?: false , help?: false , script: nil
15
+ defstruct debug?: false , gh_token: nil , help?: false , script: nil
16
16
end
17
17
18
18
def main ( args , opts \\ [ ] ) do
@@ -41,16 +41,18 @@ defmodule ElixirScript.CommandLine do
41
41
def parse_args! ( args ) do
42
42
{ parsed , _remaining_args } =
43
43
OptionParser . parse! ( args ,
44
- strict: [ script: :string , debug: :boolean , help: :boolean ] ,
44
+ strict: [ script: :string , gh_token: :string , debug: :boolean , help: :boolean ] ,
45
45
aliases: [ d: :debug , h: :help , s: :script ]
46
46
)
47
47
48
48
debug? = Keyword . get ( parsed , :debug , System . get_env ( "INPUT_DEBUG" ) == "true" )
49
- script = Keyword . get ( parsed , :script , System . get_env ( "INPUT_SCRIPT " ) )
49
+ gh_token = Keyword . get ( parsed , :gh_token , System . get_env ( "GH_TOKEN " ) )
50
50
help? = Keyword . get ( parsed , :help , false )
51
+ script = Keyword . get ( parsed , :script , System . get_env ( "INPUT_SCRIPT" ) )
51
52
52
53
% ParsedArgs {
53
54
debug?: debug? ,
55
+ gh_token: gh_token ,
54
56
help?: help? ,
55
57
script: script
56
58
}
@@ -63,6 +65,7 @@ defmodule ElixirScript.CommandLine do
63
65
64
66
Options:
65
67
--script, -s Specifies the script to run [INPUT_SCRIPT]
68
+ --gh-token The GitHub Token to use for the Tentacat client [GH_TOKEN]
66
69
--debug, -d Enables debug mode [INPUT_DEBUG]
67
70
--help, -h Show this help message and exit
68
71
0 commit comments