feat: added output file name for uml generation

This commit is contained in:
Michel Jonathan Schmitz
2019-06-05 16:15:24 +02:00
parent 67b31182e4
commit 843e59811a
6 changed files with 148 additions and 29 deletions

View File

@@ -199,6 +199,10 @@ commander
'--excludeExternals',
'Exclude external definitions',
)
.option(
'--outputFileName <fileName>',
'Defines the filename of the output',
)
.action(async (relativeSrcPath, plantumlserver, options) => {
const plantUmlConfig: UMLConfig = {
definitions:
@@ -225,9 +229,12 @@ commander
: false,
showProperties:
typeof options.showProperties !== 'undefined'
? options.showEnumValues
? options.showProperties
: false,
};
if (typeof options.outputFileName !== 'undefined') {
plantUmlConfig.outputFileName = options.outputFileName;
}
Logger.log(`PlantUML options: ${JSON.stringify(plantUmlConfig)}`);
@@ -241,10 +248,10 @@ commander
});
commander
.command('plantuml-file <file> <plantumlserver>')
.action(async (file: string, plantumlserver: string) => {
.command('plantuml-file <inputFile> <plantumlserver> [outputFile]')
.action(async (file: string, plantumlserver: string, outputFile: string) => {
const fileContent = readFileSync(resolve(file)).toString();
await createDiagramFromString(fileContent, plantumlserver);
await createDiagramFromString(fileContent, plantumlserver, outputFile);
});
commander.parse(process.argv);