All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.aeontronix.enhancedmule.tools.OrgDescriptorToMarkdownCmd Maven / Gradle / Ivy

There is a newer version: 2.0.0-alpha4
Show newest version
/*
 * Copyright (c) Aeontronix 2020
 */

package com.aeontronix.enhancedmule.tools;

import com.aeontronix.enhancedmule.tools.provisioning.OrganizationDescriptor;
import com.kloudtek.ktcli.CliCommand;
import org.slf4j.Logger;
import picocli.CommandLine;

import java.io.File;
import java.io.OutputStreamWriter;
import java.io.Writer;

import static org.slf4j.LoggerFactory.getLogger;

@CommandLine.Command(name = "org-desc-to-md", description = "Generate markdown document from org descriptor", sortOptions = false)
public class OrgDescriptorToMarkdownCmd extends CliCommand {
    private static final Logger logger = getLogger(OrgDescriptorToMarkdownCmd.class);
    @CommandLine.Option(names = {"-h", "--help"}, usageHelp = true, description = "Display this help message")
    private boolean usageHelpRequested;
    @CommandLine.Parameters(description = "Org descriptor file")
    private File file;
    @CommandLine.Option(names = {"-d", "--heading-depth"}, description = "Heading depth")
    private int headingDepth = 0;

    @Override
    protected final void execute() throws Exception {
        try (Writer os = new OutputStreamWriter(System.out)) {
            OrganizationDescriptor.toMarkdown(parent.getClient(), os, file, headingDepth);
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy