<commit_before>#!/usr/bin/env ocaml
#use "topfind"
#require "bos.setup"
#require "rresult"
open Bos_setup
open Rresult

let unsupported = Ok 1

let publish = function
  | "distrib" :: uri :: name :: version :: msg :: archive :: _ ->
      let scp = Cmd.(v "scp" % archive % (Printf.sprintf "web:/mnt/web/web/%s/distrib" name))
      in let _ = OS.Cmd.(run scp) in Ok 0
  | "doc" :: uri :: name :: version :: msg :: docdir :: _ ->
      let scp = Cmd.(v "scp" % "-r" % (Printf.sprintf "%s/*" docdir) % (Printf.sprintf "web:/mnt/web/web/%s/doc" name))
      in let _ = OS.Cmd.(run scp) in Ok 0
  | "alt" :: kind :: uri :: name :: version :: msg :: archive :: _ ->
      unsupported
  | args ->
      unsupported

let issue = function
  | "list" :: uri :: _ -> unsupported
  | "show" :: uri :: id :: _ -> unsupported
  | "open" :: uri :: title :: descr :: _ -> unsupported
  | "close" :: uri :: id :: msg :: _ -> unsupported
  | args -> unsupported

let request = function
  | "publish" :: args -> publish args
  | "issue" :: args -> issue args
  | args -> unsupported

let main () =
  let doc = "the unsupportive delegate" in
    begin match OS.Arg.(parse ~doc ~pos:string ()) with
      | "ipc" :: verbosity :: req ->
          Logs.level_of_string verbosity
            >>= fun level -> Logs.set_level level; request req
              | "ipc" :: [] ->
                  R.error_msg "malformed delegate request, verbosity is missing"
              | args ->
                  R.error_msgf "unknown arguments: %s" (String.concat ~sep:" " args)<commit_msg>ocaml delegate change folder name<commit_after>#!/usr/bin/env ocaml
#use "topfind"
#require "bos.setup"
#require "rresult"
open Bos_setup
open Rresult

let unsupported = Ok 1

let publish = function
  | "distrib" :: uri :: name :: version :: msg :: archive :: _ ->
      let scp = Cmd.(v "scp" % archive % (Printf.sprintf "web:/mnt/web/web/%s/releases" name))
      in let _ = OS.Cmd.(run scp) in Ok 0
  | "doc" :: uri :: name :: version :: msg :: docdir :: _ ->
      let scp = Cmd.(v "scp" % "-r" % (Printf.sprintf "%s/*" docdir) % (Printf.sprintf "web:/mnt/web/web/%s/doc" name))
      in let _ = OS.Cmd.(run scp) in Ok 0
  | "alt" :: kind :: uri :: name :: version :: msg :: archive :: _ ->
      unsupported
  | args ->
      unsupported

let issue = function
  | "list" :: uri :: _ -> unsupported
  | "show" :: uri :: id :: _ -> unsupported
  | "open" :: uri :: title :: descr :: _ -> unsupported
  | "close" :: uri :: id :: msg :: _ -> unsupported
  | args -> unsupported

let request = function
  | "publish" :: args -> publish args
  | "issue" :: args -> issue args
  | args -> unsupported

let main () =
  let doc = "the unsupportive delegate" in
    begin match OS.Arg.(parse ~doc ~pos:string ()) with
      | "ipc" :: verbosity :: req ->
          Logs.level_of_string verbosity
            >>= fun level -> Logs.set_level level; request req
              | "ipc" :: [] ->
                  R.error_msg "malformed delegate request, verbosity is missing"
              | args ->
                  R.error_msgf "unknown arguments: %s" (String.concat ~sep:" " args)
{'fraction_non_alphanumeric': 0.17013111608570514, 'fraction_numerical': 0.0019187719859290054, 'mean_word_length': 2.4036996735582155, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2530012', 'n_tokens_mistral': 1041, 'n_tokens_neox': 1017, 'n_words': 303}