@@ -115,7 +115,7 @@ where command is one of:
115115 eval_at_chaintip like `eval`, but does not advance to a new block.
116116 eval_at_block like `eval_at_chaintip`, but accepts a index-block-hash to evaluate at,
117117 must be passed eval string via stdin.
118- eval_raw to typecheck and evaluate an expression without a contract or database context.
118+ eval_raw to typecheck and evaluate an expression without a contract or database context from stdin .
119119 repl to typecheck and evaluate expressions in a stdin/stdout loop.
120120 execute to execute a public function of a defined contract.
121121 generate_address to generate a random Stacks public address for testing purposes.
@@ -807,7 +807,7 @@ impl HeadersDB for CLIHeadersDB {
807807fn get_eval_input ( invoked_by : & str , args : & [ String ] ) -> EvalInput {
808808 if args. len ( ) < 3 || args. len ( ) > 4 {
809809 eprintln ! (
810- "Usage: {} {} [--costs] [contract-identifier] (program.clar) [vm-state.db]" ,
810+ "Usage: {} {} [--costs] [--epoch E] [--clarity_version N] [ contract-identifier] (program.clar) [vm-state.db]" ,
811811 invoked_by, args[ 0 ]
812812 ) ;
813813 panic_test ! ( ) ;
@@ -1167,6 +1167,10 @@ pub fn invoke_command(invoked_by: &str, args: &[String]) -> (i32, Option<serde_j
11671167 }
11681168 }
11691169 "generate_address" => {
1170+ if args. len ( ) != 1 {
1171+ eprintln ! ( "Usage: {} {}" , invoked_by, args[ 0 ] ) ;
1172+ panic_test ! ( ) ;
1173+ }
11701174 // random 20 bytes
11711175 let random_bytes = rand:: thread_rng ( ) . gen :: < [ u8 ; 20 ] > ( ) ;
11721176 // version = 22
@@ -1321,6 +1325,15 @@ pub fn invoke_command(invoked_by: &str, args: &[String]) -> (i32, Option<serde_j
13211325 let epoch = parse_epoch_flag ( & mut argv) ;
13221326 let clarity_version = parse_clarity_version_flag ( & mut argv, epoch) ;
13231327 let mainnet = !matches ! ( consume_arg( & mut argv, & [ "--testnet" ] , false ) , Ok ( Some ( _) ) ) ;
1328+
1329+ if argv. len ( ) != 1 {
1330+ eprintln ! (
1331+ "Usage: {} {} [--testnet] [--epoch E] [--clarity_version N]" ,
1332+ invoked_by, args[ 0 ]
1333+ ) ;
1334+ panic_test ! ( ) ;
1335+ }
1336+
13241337 let mut marf = MemoryBackingStore :: new ( ) ;
13251338 let mut vm_env = OwnedEnvironment :: new_free (
13261339 mainnet,
@@ -1394,6 +1407,18 @@ pub fn invoke_command(invoked_by: &str, args: &[String]) -> (i32, Option<serde_j
13941407 let mut argv = args. to_vec ( ) ;
13951408 let epoch = parse_epoch_flag ( & mut argv) ;
13961409 let clarity_version = parse_clarity_version_flag ( & mut argv, epoch) ;
1410+
1411+ if argv. len ( ) != 1 {
1412+ eprintln ! (
1413+ "Usage: {} {} [--epoch E] [--clarity_version N]" ,
1414+ invoked_by, args[ 0 ]
1415+ ) ;
1416+ eprintln ! ( " Examples:" ) ;
1417+ eprintln ! ( " echo \" (+ 1 2)\" | {} {}" , invoked_by, args[ 0 ] ) ;
1418+ eprintln ! ( " {} {} < input.clar" , invoked_by, args[ 0 ] ) ;
1419+ panic_test ! ( ) ;
1420+ }
1421+
13971422 let content: String = {
13981423 let mut buffer = String :: new ( ) ;
13991424 friendly_expect (
@@ -1601,7 +1626,7 @@ pub fn invoke_command(invoked_by: &str, args: &[String]) -> (i32, Option<serde_j
16011626
16021627 if argv. len ( ) != 4 {
16031628 eprintln ! (
1604- "Usage: {} {} [--costs] [index-block-hash] [contract-identifier] [--clarity_version N] [vm/clarity dir]" ,
1629+ "Usage: {} {} [--costs] [--epoch E] [ index-block-hash] [contract-identifier] [--clarity_version N] [vm/clarity dir]" ,
16051630 invoked_by, & argv[ 0 ]
16061631 ) ;
16071632 panic_test ! ( ) ;
0 commit comments