This repository was archived by the owner on Nov 5, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +36
-22
lines changed
Expand file tree Collapse file tree 3 files changed +36
-22
lines changed Original file line number Diff line number Diff line change @@ -5,9 +5,9 @@ edition = "2021"
55license = " MIT"
66name = " lib-ruby-parser-nodes"
77repository = " https://github.com/lib-ruby-parser/nodes"
8- version = " 0.55 .0"
8+ version = " 0.56 .0"
99
1010[dependencies ]
1111liquid = " = 0.26"
1212liquid-core = " = 0.26"
13- serde = {version = " 1.0" , features = [" derive" ]}
13+ serde = { version = " 1.0" , features = [" derive" ] }
Original file line number Diff line number Diff line change @@ -3,28 +3,20 @@ fn print_usage_and_exit() -> ! {
33 std:: process:: exit ( 1 ) ;
44}
55
6- fn main ( ) {
7- let mut args = std:: env:: args ( ) . collect :: < Vec < _ > > ( ) ;
6+ fn try_arg ( key : & str ) -> Option < String > {
7+ let idx = std:: env:: args ( ) . position ( |e| e == key) ?;
8+ let value = std:: env:: args ( ) . nth ( idx + 1 ) ?;
9+ Some ( value)
10+ }
811
9- let mut get_arg = |key : & str | {
10- let key_idx = args
11- . iter ( )
12- . enumerate ( )
13- . find ( |& ( _idx, e) | e == key)
14- . unwrap_or_else ( || {
15- eprintln ! ( "Unable to get {} CLI argument" , key) ;
16- print_usage_and_exit ( )
17- } )
18- . 0 ;
19- let _key = args. remove ( key_idx) ;
20- if key_idx >= args. len ( ) {
21- eprintln ! ( "No {} CLI option given" , key) ;
22- print_usage_and_exit ( ) ;
23- }
24- let value = args. remove ( key_idx) ;
25- value
26- } ;
12+ fn get_arg ( key : & str ) -> String {
13+ try_arg ( key) . unwrap_or_else ( || {
14+ eprintln ! ( "No {} CLI option given" , key) ;
15+ print_usage_and_exit ( )
16+ } )
17+ }
2718
19+ fn main ( ) {
2820 let template_path = get_arg ( "--template" ) ;
2921 let output_path = get_arg ( "--write-to" ) ;
3022
Original file line number Diff line number Diff line change 1+ [package ]
2+ name = ' iliabylich/lib-ruby-parser-nodes'
3+ version = ' 0.56.0'
4+ description = ' Ruby parser nodes data'
5+ license = ' MIT'
6+ readme = ' README.md'
7+ repository = ' https://github.com/lib-ruby-parser/nodes'
8+
9+ # See more keys and definitions at https://docs.wasmer.io/registry/manifest
10+
11+ [[module ]]
12+ name = ' lib-ruby-parser-nodes'
13+ source = ' target/wasm32-wasi/release/examples/codegen.wasm'
14+ abi = ' wasi'
15+
16+ [module .interfaces ]
17+ wasi = ' 0.1.0-unstable'
18+
19+ [[command ]]
20+ name = ' lib-ruby-parser-nodes'
21+ module = ' lib-ruby-parser-nodes'
22+ runner = ' wasi'
You can’t perform that action at this time.
0 commit comments