@@ -43,6 +43,7 @@ public class KerMLRepositorySaveUtil extends KerMLTraversalUtil {
4343
4444 private String basePath = ApiElementProcessingFacade .DEFAULT_BASE_PATH ;
4545 private String libraryPath = null ;
46+ private boolean isAddDerivedElements = false ;
4647 private boolean isAddImplicitElements = false ;
4748 private String projectName ;
4849
@@ -109,7 +110,8 @@ protected String[] processArgs(String[] args) {
109110 int n = args .length ;
110111 if (n > 0 ) {
111112 int i = 0 ;
112- while (("-b" .equals (args [i ]) || "-l" .equals (args [i ]) || "-g" .equals (args [i ]) || "-v" .equals (args [i ])) &&
113+ while (("-b" .equals (args [i ]) || "-l" .equals (args [i ]) || "-d" .equals (args [i ]) ||
114+ "-g" .equals (args [i ]) || "-v" .equals (args [i ])) &&
113115 i + 1 < n ) {
114116 if ("-b" .equals (args [i ])) {
115117 this .basePath = args [++i ];
@@ -118,6 +120,8 @@ protected String[] processArgs(String[] args) {
118120 if (!libraryPath .endsWith ("/" )) {
119121 libraryPath += "/" ;
120122 }
123+ } else if ("-d" .equals (args [i ])) {
124+ this .isAddDerivedElements = true ;
121125 } else if ("-g" .equals (args [i ])) {
122126 this .isAddImplicitElements = true ;
123127 } else if ("-v" .equals (args [i ])) {
@@ -163,6 +167,7 @@ protected void initialize(String[] args) {
163167 ApiElementProcessingFacade processingFacade = new ApiElementProcessingFacade (this .projectName , this .getBasePath ());
164168 processingFacade .setTraversal (this .initialize (processingFacade ));
165169 processingFacade .setIsVerbose (this .isVerbose );
170+ processingFacade .setIsIncludeDerived (this .isAddDerivedElements );
166171 }
167172
168173 /**
@@ -209,13 +214,14 @@ public void run(String[] args) {
209214 *
210215 * <p>Usage:
211216 *
212- * <p>KerMLRepositorySaveUtil [-b base-path-url] [-l library-base-path] [-g] [-v] input-path [library-path library-path...]
217+ * <p>KerMLRepositorySaveUtil [-b base-path-url] [-l library-base-path] [-d] [- g] [-v] input-path [library-path library-path...]
213218 *
214219 * <p>where:
215220 *
216221 * <ul>
217222 * <li>-b base-path-url gives the URL for the base path to be used for the API endpoint (if none is given, the default is used)</li>
218223 * <li>-l library-base-path gives the base path to used for reading model library resources</li>
224+ * <li>-d specifies that derived attributes should be included (the default is not to)</li>
219225 * <li>-g specifies that implicit elements should be generated (the default is not to)</li>
220226 * <li>-v specifies verbose mode (the default is non-verbose)</li>
221227 * <li>input-path is a path for reading input resources</li>
0 commit comments