@@ -25,14 +25,14 @@ protected function configure()
2525 $ this ->addOption ('properties ' , null , InputOption::VALUE_NONE , 'List only the properties of this node ' );
2626 $ this ->addOption ('filter ' , 'f ' , InputOption::VALUE_REQUIRED |InputOption::VALUE_IS_ARRAY , 'Optional filter to apply ' );
2727 $ this ->addOption ('level ' , 'L ' , InputOption::VALUE_REQUIRED , 'Depth of tree to show ' );
28- $ this ->addOption ('no- template ' , 'T ' , InputOption::VALUE_REQUIRED , 'Do not show template nodes and properties ' );
28+ $ this ->addOption ('template ' , 't ' , InputOption::VALUE_NONE , 'Show template nodes and properties ' );
2929 $ this ->setHelp (<<<HERE
3030List both or one of the children and properties of this node.
3131
3232Multiple levels can be shown by using the <info>--level</info> option.
3333
34- The <info>node:list</info> command also shows template nodes and properties as defined a nodes node-type.
35- These can be suppressed using the <info>--no- template</info> option.
34+ The <info>node:list</info> command can also shows template nodes and properties as defined a nodes node-type by
35+ using the <info>--template</info> option. Template nodes and properties are prefixed with the "@" symbol .
3636HERE
3737 );
3838 }
@@ -46,6 +46,7 @@ public function execute(InputInterface $input, OutputInterface $output)
4646
4747 $ this ->showChildren = $ input ->getOption ('children ' );
4848 $ this ->showProperties = $ input ->getOption ('properties ' );
49+ $ this ->showTemplate = $ input ->getOption ('template ' );
4950
5051 $ session = $ this ->getHelper ('phpcr ' )->getSession ();
5152
@@ -113,14 +114,16 @@ private function renderChildren($currentNode, $table, $spacers)
113114 }
114115 }
115116
116- // render empty schematic children
117- foreach ($ childNodeNames as $ childNodeName => $ childNodeDefinition ) {
118- // @todo: Determine and show cardinality, 1..*, *..*, 0..1, etc.
119- $ table ->addRow (array (
120- '<templatenode> ' . implode ('' , $ spacers ) . '@ ' . $ childNodeName . '</templatenode> ' ,
121- implode ('| ' , $ childNodeDefinition ->getRequiredPrimaryTypeNames ()),
122- '' ,
123- ));
117+ if ($ this ->showTemplate ) {
118+ // render empty schematic children
119+ foreach ($ childNodeNames as $ childNodeName => $ childNodeDefinition ) {
120+ // @todo: Determine and show cardinality, 1..*, *..*, 0..1, etc.
121+ $ table ->addRow (array (
122+ '<templatenode> ' . implode ('' , $ spacers ) . '@ ' . $ childNodeName . '</templatenode> ' ,
123+ implode ('| ' , $ childNodeDefinition ->getRequiredPrimaryTypeNames ()),
124+ '' ,
125+ ));
126+ }
124127 }
125128 }
126129
@@ -150,12 +153,14 @@ private function renderProperties($currentNode, $table, $spacers)
150153 ));
151154 }
152155
153- foreach ($ propertyNames as $ propertyName => $ property ) {
154- $ table ->addRow (array (
155- '<templateproperty> ' . implode ('' , $ spacers ). '@ ' . $ propertyName . '</templateproperty> ' ,
156- '<property-type> ' . strtoupper (PropertyType::nameFromValue ($ property ->getRequiredType ())) . '</property-type> ' ,
157- ''
158- ));
156+ if ($ this ->showTemplate ) {
157+ foreach ($ propertyNames as $ propertyName => $ property ) {
158+ $ table ->addRow (array (
159+ '<templateproperty> ' . implode ('' , $ spacers ). '@ ' . $ propertyName . '</templateproperty> ' ,
160+ '<property-type> ' . strtoupper (PropertyType::nameFromValue ($ property ->getRequiredType ())) . '</property-type> ' ,
161+ ''
162+ ));
163+ }
159164 }
160165 }
161166}
0 commit comments