Last active
December 5, 2016 22:23
-
-
Save argent-smith/f212557f937d85a858388f17d75ea119 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OASISFormat: 0.4 | |
Name: slackbot | |
Version: 0.0.1 | |
Synopsis: Experimental slack bot in OCaml | |
Authors: Pavel Argentov (argentoff@gmail.com) | |
License: BSD-3-clause | |
Plugins: META (0.4), DevFiles (0.4), StdFiles (0.4) | |
AlphaFeatures: stdfiles_markdown | |
Executable slackbot | |
Path: src | |
BuildTools: ocamlbuild | |
BuildDepends: | |
cmdliner, | |
logs, | |
fmt | |
ByteOpt: -safe-string | |
NativeOpt: -safe-string | |
MainIs: main.ml | |
CompiledObject: best | |
SourceRepository master | |
Type: git | |
Location: https://github.com/argent-smith/slackbot-ocaml.git | |
Branch: master | |
Browser: https://github.com/argent-smith/slackbot-ocaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let hello () = Logs.app (fun m -> m "Hello from within the bot!") | |
let setup_log style_renderer level = | |
Fmt_tty.setup_std_outputs ?style_renderer (); | |
Logs.set_level level; | |
Logs.set_reporter (Logs_fmt.reporter ()); | |
() | |
open Cmdliner | |
let setup_log = | |
Term.(const setup_log $ Fmt_cli.style_renderer () $ Logs_cli.level ()) | |
let main () = | |
let doc = "Experimental bot for Slack service" in | |
match Term.(eval (const hello $ setup_log, Term.info "slackbot" ~version:"0.0.1" ~doc)) with | |
| `Error _ -> exit 1 | |
| _ -> exit (if Logs.err_count () > 0 then 1 else 0) | |
let () = main () |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment