forked from chshersh/github-tui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.ml
More file actions
51 lines (43 loc) · 1.36 KB
/
cli.ml
File metadata and controls
51 lines (43 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
open Cmdliner
let owner_repo_arg =
let doc = "The GitHub repository to view in TUI." in
Arg.(value & pos 0 string "NOT_SPECIFIED" & info [] ~docv:"OWNER/REPO" ~doc)
let path_arg =
let doc = "Path to a local directory of a GitHub repository." in
Arg.(
value
& opt (some string) None
& info [ "d"; "directory" ] ~docv:"DIRECTORY_PATH" ~doc)
let log_arg =
let doc = "Log debug information to the given file." in
Arg.(
value
& opt (some string) None
& info [ "l"; "log-to" ] ~docv:"LOG_PATH" ~doc)
let ignore_size_warning_arg =
let doc = "Ignore the minimum size warning." in
Arg.(value & flag & info [ "i"; "ignore-size-warning" ] ~doc)
let no_nerd_font_arg =
let doc = "Don't try to use Nerd Font Icons." in
Arg.(value & flag & info [ "n"; "no-nerd-font" ] ~doc)
let run owner_repo local_path log_file ignore_size_warning no_nerd_font =
Tui.start
{ owner_repo; local_path; log_file; ignore_size_warning; no_nerd_font }
let gh_tui_term =
Term.(
const run
$ owner_repo_arg
$ path_arg
$ log_arg
$ ignore_size_warning_arg
$ no_nerd_font_arg)
let cmd =
let doc = "TUI of a GitHub repository" in
let man =
[
`S Manpage.s_bugs;
`P "Submit bug reports at: https://github.com/chshersh/github-tui/issues";
]
in
let info = Cmd.info "gh-tui" ~version:"0.1.0" ~doc ~man in
Cmd.v info gh_tui_term