From fdfb00b7a6a6ea008fb9f8e41173439d3183000b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Georges=20Dup=C3=A9ron?= Date: Wed, 12 Jun 2019 01:28:38 +0200 Subject: [PATCH] Distinguish parameter and storage arguments in --help --- src/bin/cli.ml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/bin/cli.ml b/src/bin/cli.ml index 7e0606311..e10c0c28c 100644 --- a/src/bin/cli.ml +++ b/src/bin/cli.ml @@ -57,9 +57,9 @@ let entry_point n = info ~docv ~doc [] in required @@ pos n (some string) (Some "main") info -let expression n = +let expression purpose n = let open Arg in - let docv = "EXPRESSION" in + let docv = purpose ^ "_EXPRESSION" in let doc = "$(docv) is the expression that will be compiled." in let info = info ~docv ~doc [] in required @@ pos n (some string) None info @@ -97,7 +97,7 @@ let compile_parameter = ok () in let term = - Term.(const f $ source 0 $ entry_point 1 $ expression 2 $ syntax) in + Term.(const f $ source 0 $ entry_point 1 $ expression "PARAMETER" 2 $ syntax) in let cmdname = "compile-parameter" in let docs = "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 (term , Term.info ~docs cmdname) @@ -112,7 +112,7 @@ let compile_storage = ok () in let term = - Term.(const f $ source 0 $ entry_point 1 $ expression 2 $ syntax) in + Term.(const f $ source 0 $ entry_point 1 $ expression "STORAGE" 2 $ syntax) in let cmdname = "compile-storage" in let docs = "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 (term , Term.info ~docs cmdname) @@ -126,7 +126,7 @@ let dry_run = ok () in let term = - Term.(const f $ source 0 $ entry_point 1 $ expression 2 $ expression 3 $ syntax) in + Term.(const f $ source 0 $ entry_point 1 $ expression "PARAMETER" 2 $ expression "STORAGE" 3 $ syntax) in let cmdname = "dry-run" in let docs = "Subcommand: run a smart-contract with the given storage and input." in (term , Term.info ~docs cmdname) @@ -140,7 +140,7 @@ let run_function = ok () in let term = - Term.(const f $ source 0 $ entry_point 1 $ expression 2 $ syntax) in + Term.(const f $ source 0 $ entry_point 1 $ expression "PARAMETER" 2 $ syntax) in let cmdname = "run-function" in let docs = "Subcommand: run a function with the given parameter." in (term , Term.info ~docs cmdname)