class DiagnosticsReportCommand implements AdminCommand {

    @Override
    public void execute( String[] stringArgs ) throws IncorrectUsage, CommandFailed
    {
        Args args = Args.withFlags( "list", "to", "verbose", "force", PID_KEY ).parse( stringArgs );
        verbose = args.has( "verbose" );
        jmxDumper = new JMXDumper( homeDir, fs, out, err, verbose );
        pid = parsePid( args );
        boolean force = args.has( "force" );

        DiagnosticsReporter reporter = createAndRegisterSources();

        Optional<Set<String>> classifiers = parseAndValidateArguments( args, reporter );
        if ( !classifiers.isPresent() )
        {
            return;
        }

        DiagnosticsReporterProgress progress = buildProgress();

        // Start dumping
        Path destinationDir = new File( destinationArgument.parse( args ) ).toPath();
        try
        {
            Path reportFile = destinationDir.resolve( getDefaultFilename() );
            out.println( "Writing report to " + reportFile.toAbsolutePath().toString() );
            reporter.dump( classifiers.get(), reportFile, progress, force );
        }
        catch ( IOException e )
        {
            throw new CommandFailed( "Creating archive failed", e );
        }
    }

      DiagnosticsReportCommand( Path homeDir, Path configDir, OutsideWorld outsideWorld );

}