WIP: Add CLI

This commit is contained in:
Dmitrii Kovanikov 2024-01-07 12:57:06 +00:00
parent e9d760cf39
commit 06f9cf2b45
6 changed files with 29 additions and 10 deletions

View File

@ -17,4 +17,4 @@ query {
|} |}
*) *)
let () = Github_tui.Tui.start () let () = Github_tui.Main.main ()

View File

@ -17,11 +17,13 @@
(synopsis "A short synopsis") (synopsis "A short synopsis")
(description "A longer description") (description "A longer description")
(depends (depends
ocaml (ocaml (>= "5.1"))
dune dune
ezcurl (core (>= "v0.16.2"))
minttea (core_unix (>= "v0.16.0"))
terminal (ezcurl (>= "0.2.4"))
(minttea (>= "0.0.2"))
(ppx_jane (>= "v0.16.0"))
) )
(tags (tags
(tui cli git github))) (tui cli git github)))

View File

@ -9,11 +9,13 @@ tags: ["tui" "cli" "git" "github"]
homepage: "https://github.com/chshersh/github-tui" homepage: "https://github.com/chshersh/github-tui"
bug-reports: "https://github.com/chshersh/github-tui/issues" bug-reports: "https://github.com/chshersh/github-tui/issues"
depends: [ depends: [
"ocaml" "ocaml" {>= "5.1"}
"dune" {>= "3.12"} "dune" {>= "3.12"}
"ezcurl" "core" {>= "v0.16.2"}
"minttea" "core_unix" {>= "v0.16.0"}
"terminal" "ezcurl" {>= "0.2.4"}
"minttea" {>= "0.0.2"}
"ppx_jane" {>= "v0.16.0"}
"odoc" {with-doc} "odoc" {with-doc}
] ]
build: [ build: [

10
lib/cli.ml Normal file
View File

@ -0,0 +1,10 @@
open Core
let repo_param =
let open Command.Param in
anon ("owner/repo" %: string)
let command =
Command.basic
~summary:"Display GitHub TUI for the selected repository"
(Command.Param.map repo_param ~f:(fun _repo () -> Tui.start ()))

View File

@ -3,8 +3,12 @@
(library (library
(name github_tui) (name github_tui)
(libraries (libraries
core
core_unix.command_unix
ezcurl ezcurl
minttea minttea
terminal )
(preprocess
(pps ppx_jane)
) )
) )

1
lib/main.ml Normal file
View File

@ -0,0 +1 @@
let main () = Command_unix.run ~version:"0.1.0" ~build_info:"RWO" Cli.command