Mention subcommand --help only once

This commit is contained in:
Tom Jack 2019-11-21 11:44:27 -06:00
parent e3fbc58e7a
commit 0040b1f460
2 changed files with 22 additions and 24 deletions

View File

@ -3,7 +3,10 @@ open Trace
open Cli_helpers open Cli_helpers
let main = let main =
(Term.(ret (const (`Help (`Auto, None)))) , Term.info "ligo") let man =
[ `S "MORE HELP";
`P "Use `$(mname) $(i,COMMAND) --help' for help on a single command." ] in
(Term.(ret (const (`Help (`Auto, None)))), Term.info "ligo" ~man)
let source_file n = let source_file n =
let open Arg in let open Arg in
@ -94,7 +97,7 @@ let compile_file =
let term = let term =
Term.(const f $ source_file 0 $ entry_point 1 $ syntax $ display_format $ michelson_code_format) in Term.(const f $ source_file 0 $ entry_point 1 $ syntax $ display_format $ michelson_code_format) in
let cmdname = "compile-contract" in let cmdname = "compile-contract" in
let doc = "Subcommand: compile a contract. See `ligo " ^ cmdname ^ " --help' for a list of options specific to this subcommand." in let doc = "Subcommand: compile a contract." in
(term , Term.info ~doc cmdname) (term , Term.info ~doc cmdname)
let compile_parameter = let compile_parameter =
@ -108,7 +111,7 @@ let compile_parameter =
let term = let term =
Term.(const f $ source_file 0 $ entry_point 1 $ expression "PARAMETER" 2 $ syntax $ display_format $ michelson_code_format) in Term.(const f $ source_file 0 $ entry_point 1 $ expression "PARAMETER" 2 $ syntax $ display_format $ michelson_code_format) in
let cmdname = "compile-parameter" in let cmdname = "compile-parameter" in
let doc = "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 " ^ cmdname ^ " --help' for a list of options specific to this subcommand." in let doc = "Subcommand: compile parameters to a michelson expression. The resulting michelson expression can be passed as an argument in a transaction which calls a contract." in
(term , Term.info ~doc cmdname) (term , Term.info ~doc cmdname)
let compile_storage = let compile_storage =
@ -122,7 +125,7 @@ let compile_storage =
let term = let term =
Term.(const f $ source_file 0 $ entry_point 1 $ expression "STORAGE" 2 $ syntax $ display_format $ michelson_code_format) in Term.(const f $ source_file 0 $ entry_point 1 $ expression "STORAGE" 2 $ syntax $ display_format $ michelson_code_format) in
let cmdname = "compile-storage" in let cmdname = "compile-storage" in
let doc = "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 " ^ cmdname ^ " --help' for a list of options specific to this subcommand." in let doc = "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." in
(term , Term.info ~doc cmdname) (term , Term.info ~doc cmdname)
let dry_run = let dry_run =

View File

@ -10,10 +10,12 @@ let%expect_test _ =
SYNOPSIS SYNOPSIS
ligo COMMAND ... ligo COMMAND ...
MORE HELP
Use `ligo COMMAND --help' for help on a single command.
COMMANDS COMMANDS
compile-contract compile-contract
Subcommand: compile a contract. See `ligo compile-contract --help' Subcommand: compile a contract.
for a list of options specific to this subcommand.
compile-expression compile-expression
Subcommand: compile to a michelson value. Subcommand: compile to a michelson value.
@ -21,15 +23,13 @@ let%expect_test _ =
compile-parameter compile-parameter
Subcommand: compile parameters to a michelson expression. The Subcommand: compile parameters to a michelson expression. The
resulting michelson expression can be passed as an argument in a resulting michelson expression can be passed as an argument in a
transaction which calls a contract. See `ligo compile-parameter transaction which calls a contract.
--help' for a list of options specific to this subcommand.
compile-storage compile-storage
Subcommand: compile an initial storage in ligo syntax to a Subcommand: compile an initial storage in ligo syntax to a
michelson expression. The resulting michelson expression can be michelson expression. The resulting michelson expression can be
passed as an argument in a transaction which originates a passed as an argument in a transaction which originates a
contract. See `ligo compile-storage --help' for a list of options contract.
specific to this subcommand.
dry-run dry-run
Subcommand: run a smart-contract with the given storage and input. Subcommand: run a smart-contract with the given storage and input.
@ -54,10 +54,12 @@ let%expect_test _ =
SYNOPSIS SYNOPSIS
ligo COMMAND ... ligo COMMAND ...
MORE HELP
Use `ligo COMMAND --help' for help on a single command.
COMMANDS COMMANDS
compile-contract compile-contract
Subcommand: compile a contract. See `ligo compile-contract --help' Subcommand: compile a contract.
for a list of options specific to this subcommand.
compile-expression compile-expression
Subcommand: compile to a michelson value. Subcommand: compile to a michelson value.
@ -65,15 +67,13 @@ let%expect_test _ =
compile-parameter compile-parameter
Subcommand: compile parameters to a michelson expression. The Subcommand: compile parameters to a michelson expression. The
resulting michelson expression can be passed as an argument in a resulting michelson expression can be passed as an argument in a
transaction which calls a contract. See `ligo compile-parameter transaction which calls a contract.
--help' for a list of options specific to this subcommand.
compile-storage compile-storage
Subcommand: compile an initial storage in ligo syntax to a Subcommand: compile an initial storage in ligo syntax to a
michelson expression. The resulting michelson expression can be michelson expression. The resulting michelson expression can be
passed as an argument in a transaction which originates a passed as an argument in a transaction which originates a
contract. See `ligo compile-storage --help' for a list of options contract.
specific to this subcommand.
dry-run dry-run
Subcommand: run a smart-contract with the given storage and input. Subcommand: run a smart-contract with the given storage and input.
@ -93,9 +93,7 @@ let%expect_test _ =
run_ligo_good [ "compile-contract" ; "--help" ] ; run_ligo_good [ "compile-contract" ; "--help" ] ;
[%expect {| [%expect {|
NAME NAME
ligo-compile-contract - Subcommand: compile a contract. See `ligo ligo-compile-contract - Subcommand: compile a contract.
compile-contract --help' for a list of options specific to this
subcommand.
SYNOPSIS SYNOPSIS
ligo compile-contract [OPTION]... SOURCE_FILE ENTRY_POINT ligo compile-contract [OPTION]... SOURCE_FILE ENTRY_POINT
@ -137,9 +135,7 @@ let%expect_test _ =
NAME NAME
ligo-compile-parameter - Subcommand: compile parameters to a michelson ligo-compile-parameter - Subcommand: compile parameters to a michelson
expression. The resulting michelson expression can be passed as an expression. The resulting michelson expression can be passed as an
argument in a transaction which calls a contract. See `ligo argument in a transaction which calls a contract.
compile-parameter --help' for a list of options specific to this
subcommand.
SYNOPSIS SYNOPSIS
ligo compile-parameter [OPTION]... SOURCE_FILE ENTRY_POINT ligo compile-parameter [OPTION]... SOURCE_FILE ENTRY_POINT
@ -186,8 +182,7 @@ let%expect_test _ =
ligo-compile-storage - Subcommand: compile an initial storage in ligo ligo-compile-storage - Subcommand: compile an initial storage in ligo
syntax to a michelson expression. The resulting michelson expression syntax to a michelson expression. The resulting michelson expression
can be passed as an argument in a transaction which originates a can be passed as an argument in a transaction which originates a
contract. See `ligo compile-storage --help' for a list of options contract.
specific to this subcommand.
SYNOPSIS SYNOPSIS
ligo compile-storage [OPTION]... SOURCE_FILE ENTRY_POINT ligo compile-storage [OPTION]... SOURCE_FILE ENTRY_POINT