@@ -5,9 +5,9 @@ import ReplMaker
5
5
6
6
export gitrepl
7
7
8
- const GIT_REPL_MODE_NAME = " GitRepl.jl Git REPL mode"
8
+ const GIT_REPL_MODE_NAME = " GitRepl.jl Git REPL mode"
9
9
const GIT_REPL_MODE_PROMPT_TEXT = " git> "
10
- const GIT_REPL_MODE_START_KEY = ' ,'
10
+ const GIT_REPL_MODE_START_KEY = ' ,'
11
11
12
12
function _gitrepl_parser (repl_input:: AbstractString )
13
13
return quote
@@ -17,18 +17,49 @@ function _gitrepl_parser(repl_input::AbstractString)
17
17
end
18
18
end
19
19
20
- function gitrepl (; mode_name = GIT_REPL_MODE_NAME,
21
- prompt_text = GIT_REPL_MODE_PROMPT_TEXT,
22
- start_key = GIT_REPL_MODE_START_KEY,
20
+ """
21
+ gitrepl(; kwargs...)
22
+
23
+ Set up the Git REPL mode.
24
+
25
+ ## Optional keyword arguments
26
+
27
+ | Name | Type | Default Value |
28
+ |:------------- | :--------------- |:-------------------------------------|
29
+ | `mode_name` | `AbstractString` | `$(repr (GIT_REPL_MODE_NAME)) ` |
30
+ | `prompt_text` | `AbstractString` | `$(repr (GIT_REPL_MODE_PROMPT_TEXT)) ` |
31
+ | `start_key` | `AbstractChar` | `$(repr (GIT_REPL_MODE_START_KEY)) ` |
32
+
33
+ ## Descriptions of optional keyword arguments:
34
+
35
+ | Name | Description |
36
+ |:------------- | :-------------------------------------------------- |
37
+ | `mode_name` | Name of the REPL mode |
38
+ | `prompt_text` | Prompt text to display when the REPL mode is active |
39
+ | `start_key` | Key to press to enter the REPL mode |
40
+
41
+ """
42
+ function gitrepl (; mode_name:: AbstractString = GIT_REPL_MODE_NAME,
43
+ prompt_text:: AbstractString = GIT_REPL_MODE_PROMPT_TEXT,
44
+ start_key:: AbstractChar = GIT_REPL_MODE_START_KEY,
23
45
kwargs... )
24
46
ReplMaker. initrepl (
25
47
_gitrepl_parser;
26
- mode_name = mode_name ,
27
- prompt_text = prompt_text ,
28
- start_key = start_key ,
29
- kwargs... ,
48
+ mode_name,
49
+ prompt_text,
50
+ start_key,
51
+ kwargs...
30
52
)
31
53
return nothing
32
54
end
33
55
56
+ function __init__ ()
57
+ try
58
+ gitrepl ()
59
+ catch ex
60
+ @error (" " , exception= (ex, catch_backtrace ()))
61
+ end
62
+ return nothing
63
+ end
64
+
34
65
end # module
0 commit comments