# Artistic Style Scripts

The following are scripts to support the Artistic Style program. They are in various computer languages for multiple platforms.

### Scripts

astyle-clean.py is a Python script to clean a directory tree by moving Artistic Style backup files to a separate directory. This allows Artistic Style to create backup files without cluttering your source directories. There are four variables at the start of the script that need to be set for each application. The script will move or copy backup files to a backup directory maintaining the original directory structure. New backup files will be copied over the old so you will always have the most current backup.

astyle-clean.sh is a Linux shell script to clean a directory tree by moving Artistic Style backup files to a separate directory. This allows Artistic Style to create backup files without cluttering your source directories. There are four variables at the start of the script that need to be set for each application. The script will move or copy backup files to a backup directory maintaining the original directory structure. New backup files will be copied over the old so you will always have the most current backup.

astyle-clean.bat is a Windows batch file to clean a directory tree by moving Artistic Style backup files to a separate directory. This allows Artistic Style to create backup files without cluttering your source directories. There are four variables at the start of the script that need to be set for each application. The script will move or copy backup files to a backup directory maintaining the original directory structure. New backup files will be copied over the old so you will always have the most current backup.

astyle.pl is a Mac Perl script to indent source files in TextWrangler and BBEdit using Artistic Style. Selected text from the editor can be passed to Artistic Style and replaced with the reformatted text. Save the script in the "Unix Filters" directory (you need to restart TextWrangler to see new scripts). Then simply highlight the text you would like to indent, choose the script from the Shebang (`#!`) menu, and the text will be immaculately formatted. You can add Artistic Style options to the "my $astyle" line in the script.

indent-commit.pl is a Perl script to integrate Artistic Style with a CVS repository check-in. Before code is checked in, Artistic Style is automatically called so that the repository files have a consistent style. This script was posted on the web site several years ago and probably needs to be updated.

astyle-hooks.el is an Emacs Lisp script containing hooks to convert Emacs default styles to Artistic Style default styles. There are hooks for C++, Java, and C# files. The C# hook requires the csharp-mode.el file from csharpmode on Google Project Hosting. For best results Artistic Style should use the options ‑‑min‑conditional‑indent=0 (‑m0) and ‑‑max‑instatement‑indent=50 (‑M50). Emacs does not seem to have an option equivalent to these. The formatting for Emacs and Artistic Style will not be identical but should be reasonably close.