github.com/lmorg/murex@v0.0.0-20240217211045-e081c89cd4ef/integrations/yarn_any.mx (about) 1 !if { which yarn } then { 2 return 3 } 4 5 autocomplete: <!null> set yarn ({[ 6 { 7 "CacheTTL": 30, 8 "Dynamic": ({ 9 g: ${yarn <!null> bin}/* -> regexp: s,^.*/,, 10 }), 11 "FlagsDesc": ${ 12 trypipe <!null> { 13 yarn help -> tabulate: --key-value --split-comma --key-inc-hint --map 14 } 15 }, 16 "Optional": true, 17 "AllowMultiple": true, 18 "AllowNoFlagValue": true, 19 "FlagValues": {"*": [ 20 { "IncDirs": true }, 21 { "Goto": "/0" } 22 ]} 23 }, 24 { 25 "DynamicDesc": ({ 26 cast json 27 if { g: package.json } then { 28 open package.json -> [ scripts ] 29 } 30 }), 31 "Optional": true 32 }, 33 { 34 "Flags": ${ 35 trypipe <!null> { 36 yarn help -> @[Commands..Run]re -> [:1] -> cast str -> format json 37 } 38 }, 39 "FlagValues": { 40 ${ 41 trypipe <!null> { 42 yarn help -> @[Commands..Run]re -> [:1] -> foreach MOD.cmd { 43 out ("$MOD.cmd": 44 [{ 45 "DynamicDesc": ({ 46 yarn help $MOD.cmd -> tabulate: --key-value --split-comma --key-inc-hint --map 47 }), 48 "AllowMultiple": true, 49 "AllowNoFlagValue": true, 50 "FlagValues": {"*": [ 51 { "IncDirs": true }, 52 { "Goto": "/2/add/0" } 53 ]} 54 }],) 55 } 56 } 57 } 58 "": [{ }] 59 } 60 } 61 ]})