mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-09 13:16:44 +01:00
implement expose stubs for subcommands
This commit is contained in:
parent
87cd6099ad
commit
6d4a629311
3 changed files with 68 additions and 5 deletions
|
|
@ -122,8 +122,7 @@ impl Configuration {
|
|||
return Err(format!("(e4) unexpected non-symbol {next:?}").into())
|
||||
};
|
||||
|
||||
let next = exp.next();
|
||||
if let Some(Token { value: Value::Str(path), .. }) = next {
|
||||
if let Some(Token { value: Value::Str(path), .. }) = exp.peek() {
|
||||
let path = base.as_ref().parent().unwrap().join(unquote(path));
|
||||
if !std::fs::exists(&path)? {
|
||||
return Err(format!("(e5) not found: {path:?}").into())
|
||||
|
|
@ -133,8 +132,9 @@ impl Configuration {
|
|||
println!("ok");
|
||||
let cond = cond.unwrap();
|
||||
map.add_layer_if(
|
||||
Box::new(|state|{
|
||||
Context::get(state, &Value::Sym(cond)).unwrap_or(false)
|
||||
Box::new(move |state|{
|
||||
let mut exp = exp.clone();
|
||||
Context::get(state, &mut exp).unwrap_or(false)
|
||||
}),
|
||||
keys
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue