Skip to content

Commit

Permalink
For-each now prints the node name for $ {..} in shell.
Browse files Browse the repository at this point in the history
  • Loading branch information
weetmuts committed Nov 24, 2024
1 parent d15c9c9 commit 59707b7
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/c/xmq-cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -2955,6 +2955,11 @@ char *grab_content(xmlNode *n, const char *name)
{
MemBuffer *buf = new_membuffer();

if (!strcmp(name, ".."))
{
membuffer_append(buf, (char*)n->name);
}
else
if (!strcmp(name, "."))
{
append_text_node(buf, n);
Expand Down
17 changes: 17 additions & 0 deletions tests/cmd_005_for_each_dotdot.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
INPUT
enter {
test {
name = Howdy
data = '1 2 3'
}
test {
name = Dowdy
data = '4 5 6'
}
}
OUTPUT
name=Howdy
name=Dowdy
END
ARGS
CMDS for-each /enter/test/name --shell='echo ${..}="${.}"'

0 comments on commit 59707b7

Please sign in to comment.