=== removed file '.bzrignore' --- .bzrignore 2019-04-11 14:01:44 +0000 +++ .bzrignore 1970-01-01 00:00:00 +0000 @@ -1,3 +0,0 @@ -_build -*.cmi -*.cmo === modified file '.merlin' --- .merlin 2019-04-11 14:01:44 +0000 +++ .merlin 2019-04-10 19:36:12 +0000 @@ -4,6 +4,4 @@ PKG async PKG core_extended PKG ppx_let -PKG ppx_deriving -PKG ppx_deriving.show EXT nonrec === modified file 'Makefile' --- Makefile 2019-04-11 14:01:44 +0000 +++ Makefile 2019-04-10 19:36:12 +0000 @@ -1,7 +1,7 @@ all: ppio.bc clean: - rm -rf _build *.o *.bc *.cm[iox] + rm -f *.o *.bc *.cm[iox] ppio.bc: ppio.ml compile ./compile ppio.ml -o ppio.bc === modified file 'compile' --- compile 2019-04-11 14:01:44 +0000 +++ compile 2019-04-10 19:36:12 +0000 @@ -1,10 +1,2 @@ #!/bin/sh -set -x -exec ocamlfind ocamlc \ - -linkpkg \ - -package core \ - -package ppx_deriving \ - -package ppx_deriving.show \ - -package ppx_let \ - -thread \ - "$@" +exec ocamlfind ocamlc -linkpkg -package core -package ppx_let -thread "$@" === modified file 'ppio.ml' --- ppio.ml 2019-04-11 14:01:44 +0000 +++ ppio.ml 2019-04-11 11:08:29 +0000 @@ -21,31 +21,6 @@ let pp_string_list l = String.concat ~sep:" " (List.map l (sprintf "%S"));; -type color_pair = {normal: string; escaped: string} [@@deriving show];; -type color_scheme = {i: color_pair; o:color_pair} [@@deriving show];; -type cmd_args = { - hideendl: bool; - endl: string; - color: color_scheme option; - exe: string list; -} [@@deriving show];; - -let print_color_pair {normal; escaped} = - sprintf "{normal=%S; escaped=%S}" normal escaped -;; -let print_color_scheme {i; o} = - sprintf "{i=%s; o=%s}" (print_color_pair i) (print_color_pair o) -;; -let print_cmd_args {hideendl; endl; color; exe} = - printf "hide: %B\n" hideendl; - printf "endl: %S\n" endl; - (match color with - | None -> printf "colors: none\n"; - | Some cs -> printf "colors: %s\n" (print_color_scheme cs); - ); - printf "exe: %s\n" (pp_string_list exe); -;; - let cmd = let open Command.Let_syntax in let flag_const value = @@ -69,7 +44,7 @@ |> flag_const ""; ] and color = choose_one ~if_nothing_chosen:(`Default_to ( - Some ["32";"36";"31";"35"] + Some "32 36 31 35" )) [ flag "-c" ~aliases:["--nocolor"; "--no-color"] no_arg ~doc:"Don't use colors to distinguish input from output" @@ -77,30 +52,25 @@ flag "-C" ~aliases:["--colors"; "--colours"] (optional string) ~doc:"COLORS A quad of VT color numbers" |> map ~f:(fun x -> match x with - | Some s -> Some (Some (String.split s ' ')) + | Some s -> Some (Some s) | None -> None); ] and exe = flag "--" escape ~doc:"EXE Command to execute" and exe2 = anon (sequence ("EXE"%:string)) in fun () -> - let args = { - hideendl=hide; - endl=endl; - color=(match color with - | None -> None - | Some l -> Some { - i={normal=List.nth_exn l 0; escaped=List.nth_exn l 1}; - o={normal=List.nth_exn l 2; escaped=List.nth_exn l 3}; - }); - exe=(match exe with - | None -> exe2 - | Some l -> l - ); - } + Out_channel.output_string stdout "Beep boop!\n"; + printf "hide: %B\n" hide; + printf "endl: %S\n" endl; + (match color with + | None -> printf "colors: none\n"; + | Some s -> printf "colors: %S\n" s; + ); + let real_exe = match exe with + | None -> exe2 + | Some l -> l in - print_cmd_args args; - (* show args; *) + printf "exe: %s\n" (pp_string_list real_exe); ] ;;