Skip to content

Commit 59707b7

Browse files
committed
For-each now prints the node name for $ {..} in shell.
1 parent d15c9c9 commit 59707b7

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

src/main/c/xmq-cli.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2955,6 +2955,11 @@ char *grab_content(xmlNode *n, const char *name)
29552955
{
29562956
MemBuffer *buf = new_membuffer();
29572957

2958+
if (!strcmp(name, ".."))
2959+
{
2960+
membuffer_append(buf, (char*)n->name);
2961+
}
2962+
else
29582963
if (!strcmp(name, "."))
29592964
{
29602965
append_text_node(buf, n);

tests/cmd_005_for_each_dotdot.test

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
INPUT
2+
enter {
3+
test {
4+
name = Howdy
5+
data = '1 2 3'
6+
}
7+
test {
8+
name = Dowdy
9+
data = '4 5 6'
10+
}
11+
}
12+
OUTPUT
13+
name=Howdy
14+
name=Dowdy
15+
END
16+
ARGS
17+
CMDS for-each /enter/test/name --shell='echo ${..}="${.}"'

0 commit comments

Comments
 (0)