xref: /freebsd/contrib/libxo/tests/xo/xo_01.sh (revision 313376588638950ba1e93c403dd8c97bc52fd3a2)
1*31337658SMarcel Moolenaar#
2*31337658SMarcel Moolenaar# $Id$
3*31337658SMarcel Moolenaar#
4*31337658SMarcel Moolenaar# Copyright 2014, Juniper Networks, Inc.
5*31337658SMarcel Moolenaar# All rights reserved.
6*31337658SMarcel Moolenaar# This SOFTWARE is licensed under the LICENSE provided in the
7*31337658SMarcel Moolenaar# ../Copyright file. By downloading, installing, copying, or otherwise
8*31337658SMarcel Moolenaar# using the SOFTWARE, you agree to be bound by the terms of that
9*31337658SMarcel Moolenaar# LICENSE.
10*31337658SMarcel Moolenaar
11*31337658SMarcel MoolenaarXO=$1
12*31337658SMarcel Moolenaarshift
13*31337658SMarcel Moolenaar
14*31337658SMarcel MoolenaarXOP="${XO} --warn --depth 1 --leading-xpath /top"
15*31337658SMarcel Moolenaar
16*31337658SMarcel Moolenaar${XO} --open top
17*31337658SMarcel Moolenaar
18*31337658SMarcel MoolenaarNF=
19*31337658SMarcel Moolenaarfor i in one:1:red two:2:blue three:3:green four:4:yellow ; do
20*31337658SMarcel Moolenaar    set `echo $i | sed 's/:/ /g'`
21*31337658SMarcel Moolenaar    ${XOP} ${NF} --wrap item \
22*31337658SMarcel Moolenaar        'Item {k:name} is {Lw:number}{:value/%03d/%d}, {Lwc:color}{:color}\n' \
23*31337658SMarcel Moolenaar         $1 $2 $3
24*31337658SMarcel Moolenaar    NF=--not-first
25*31337658SMarcel Moolenaardone
26*31337658SMarcel Moolenaar
27*31337658SMarcel Moolenaar${XO} --close top