Show help instead of "Do ligo --help"

This commit is contained in:
Tom Jack 2019-11-21 11:43:34 -06:00
parent 32625bb075
commit e3fbc58e7a
2 changed files with 43 additions and 3 deletions

View File

@ -3,8 +3,7 @@ open Trace
open Cli_helpers open Cli_helpers
let main = let main =
let term = Term.(const print_endline $ const "Ligo needs a command. Do ligo --help") in (Term.(ret (const (`Help (`Auto, None)))) , Term.info "ligo")
(term , Term.info "ligo")
let source_file n = let source_file n =
let open Arg in let open Arg in

View File

@ -3,7 +3,48 @@ open Cli_expect
let%expect_test _ = let%expect_test _ =
(* TODO good? *) (* TODO good? *)
run_ligo_good [] ; run_ligo_good [] ;
[%expect {| Ligo needs a command. Do ligo --help |} ] ; [%expect {|
NAME
ligo
SYNOPSIS
ligo COMMAND ...
COMMANDS
compile-contract
Subcommand: compile a contract. See `ligo compile-contract --help'
for a list of options specific to this subcommand.
compile-expression
Subcommand: compile to a michelson value.
compile-parameter
Subcommand: compile parameters to a michelson expression. The
resulting michelson expression can be passed as an argument in a
transaction which calls a contract. See `ligo compile-parameter
--help' for a list of options specific to this subcommand.
compile-storage
Subcommand: compile an initial storage in ligo syntax to a
michelson expression. The resulting michelson expression can be
passed as an argument in a transaction which originates a
contract. See `ligo compile-storage --help' for a list of options
specific to this subcommand.
dry-run
Subcommand: run a smart-contract with the given storage and input.
evaluate-value
Subcommand: evaluate a given definition.
run-function
Subcommand: run a function with the given parameter.
OPTIONS
--help[=FMT] (default=auto)
Show this help in format FMT. The value FMT must be one of `auto',
`pager', `groff' or `plain'. With `auto', the format is `pager` or
`plain' whenever the TERM env var is `dumb' or undefined. |} ] ;
run_ligo_good [ "--help" ] ; run_ligo_good [ "--help" ] ;
[%expect {| [%expect {|