id = "astyle"
name = "Artistic Style"
homepage = "https://astyle.sourceforge.net"
description = "A source code indenter, formatter, and beautifier for the C, C++, C++/CLI, Objective-C, C# and Java programming languages."
executables = ["astyle"]
[dotfiles]
paths = [
"~/.astylerc",
"%APPDATA%/astylerc",
]
exclude = []
secret = []
side_effect = false
[commands]
format = 1
label = "Format source code"
description = "Reformat C, C++, C#, Java or Objective-C files in place with Artistic Style. Keeps a .orig backup unless disabled. Only the common style options are covered."
quality = "ai-draft"
parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = false }
[[commands.source]]
id = "manual"
kind = "manual"
url = "https://astyle.sourceforge.net/astyle.html"
revision = "2026-10-27"
evidence = """
astyle [OPTIONS] SourceFilePath
--style=allman / --style=bsd / --style=break / -A1
--style=java / --style=attach / -A2
--style=kr / --style=k&r / --style=k/r / -A3
--style=stroustrup / -A4
--style=google / -A14
style=whitesmith style=vtk style=ratliff style=gnu style=linux style=horstmann style=1tbs style=mozilla style=webkit style=pico style=lisp
--indent=spaces / --indent=spaces=# / -s#
--indent=tab / --indent=tab=# / -t / -t#
--pad-oper / -p
--pad-header / -H
--break-blocks / -f
--add-braces / -j
--suffix=none / -n
--recursive / -r / -R
--dry-run
--formatted / -Q
--quiet / -q
--exclude=####
--preserve-date / -Z
--options=
"""
[[commands.field]]
id = "files"
label = "Source files"
description = "Files or wildcards. With recursive, use a wildcard such as \"src/*.cpp\"."
type = "path"
path = { kind = "any", role = "input" }
position = 0
multiple = true
min = 1
sources = ["manual"]
[[commands.field]]
id = "style"
label = "Brace style"
type = "enum"
option = ["--style"]
choices = [{ value = "allman", label = "Allman" }, { value = "java", label = "Java" }, { value = "kr", label = "K&R" }, { value = "stroustrup", label = "Stroustrup" }, { value = "google", label = "Google" }]
sources = ["manual"]
[[commands.field]]
id = "indent_spaces"
label = "Indent with spaces"
description = "Spaces per indent, 2 to 20."
type = "integer"
option = ["--indent=spaces"]
sources = ["manual"]
[[commands.field]]
id = "pad_oper"
label = "Pad operators"
type = "boolean"
option = ["--pad-oper", "-p"]
sources = ["manual"]
[[commands.field]]
id = "pad_header"
label = "Pad after if/for/while"
type = "boolean"
option = ["--pad-header", "-H"]
sources = ["manual"]
[[commands.field]]
id = "break_blocks"
label = "Blank lines around blocks"
type = "boolean"
option = ["--break-blocks", "-f"]
sources = ["manual"]
[[commands.field]]
id = "add_braces"
label = "Add braces to one-line statements"
type = "boolean"
option = ["--add-braces", "-j"]
effect = "overwrite"
sources = ["manual"]
[[commands.field]]
id = "no_backup"
label = "Do not keep .orig backup"
type = "boolean"
option = ["--suffix=none", "-n"]
effect = "overwrite"
sources = ["manual"]
[[commands.field]]
id = "recursive"
label = "Recurse into directories"
type = "boolean"
option = ["--recursive", "-r"]
sources = ["manual"]
[[commands.field]]
id = "dry_run"
label = "Dry run"
type = "boolean"
option = ["--dry-run"]
sources = ["manual"]
[[commands.field]]
id = "options_file"
label = "Options file"
type = "path"
path = { kind = "file", role = "input" }
option = ["--options"]
sources = ["manual"]
[[commands.task]]
id = "format"
label = "Format files"
fields = ["files", "style", "indent_spaces", "pad_oper", "no_backup"]
required = ["files"]
[[commands.task]]
id = "preview"
label = "Preview changes"
set = { dry_run = [true] }
lock = ["dry_run"]
fields = ["files", "style", "indent_spaces", "dry_run", "recursive"]
required = ["files"]
[[commands.group]]
id = "basic"
label = "Basic"
fields = ["files", "style", "indent_spaces", "recursive", "dry_run"]
[[commands.group]]
id = "advanced"
label = "Advanced"
fields = ["pad_oper", "pad_header", "break_blocks", "add_braces", "no_backup", "options_file"]