Menu

Formatting_from_the_command_line

Ernest

The formatter was not designed to be used from the command line, but neither is the base code intertwined with the Eclipse visuals.
Here are the steps that I took:

  1. Export your format preferences to a file from the Flex Formatter preference page.
  2. Create a directory on disk, and add the FlexFormatter jars into it (extract them from the main zipfile download)
  3. Pull down the command line support zip file from FlexFormatter files and extract the jars inside into your target directory.
  4. Issue a command line similar to the following from the directory you've created:
    java -Djava.ext.dirs=. utilities.CommandLine c:\temp\CLTest c:\public\Tools\Format1.properties 3 false

    • c:\temp\CLTest is a top level directory containing your source files that should be formatted. The directory will be processed recursively.
    • c:\public\Tools\Format1.properties contains formatter preferences.
    • 3 is the desired tab/indent size
    • false=indent only, true=format

Related

Wiki: Old_Docmanager_Index

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.