Shells in OCaml
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

Expand patterns in cases

+38 -1
+14 -1
src/lib/eval.ml
··· 1065 1065 match inner_acc with 1066 1066 | Some _ as v -> v 1067 1067 | None -> 1068 - let pattern = word_cst_to_string pattern in 1068 + let _, pattern = 1069 + word_expansion 1070 + { 1071 + ctx with 1072 + options = 1073 + Built_ins.Options.with_options 1074 + ~no_path_expansion:true ctx.options; 1075 + } 1076 + pattern 1077 + in 1078 + let pattern = 1079 + Ast.Fragment.join_list ~sep:"" 1080 + (List.concat pattern) 1081 + in 1069 1082 if Glob.test ~pattern scrutinee then begin 1070 1083 match sub with 1071 1084 | Some sub -> Some (exec_subshell ctx sub)
+24
test/cases.t
··· 37 37 All good... 38 38 Stopping service 39 39 Unknown command: foo 40 + 41 + 42 + $ cat > test.sh << EOF 43 + > contains () { 44 + > case \$1 in 45 + > *\$2*) 46 + > echo "Yep, \$2 is in \$1" 47 + > ;; 48 + > *) 49 + > echo "\$1 does not contain \$2" 50 + > ;; 51 + > esac 52 + > } 53 + > 54 + > contains "radar" "ada" 55 + > contains "hello" "ee" 56 + > EOF 57 + 58 + $ sh test.sh 59 + Yep, ada is in radar 60 + hello does not contain ee 61 + $ msh test.sh 62 + Yep, ada is in radar 63 + hello does not contain ee