A simple, feature-rich command-line arguments parsing library for Scala with support for Scala Native and Scala.js.
Scallop is a command-line arguments parsing library for Scala that enables developers to define, parse, and validate CLI options and arguments in a type-safe manner. It solves the problem of building robust command-line interfaces by supporting POSIX/GNU-style options, subcommands, and complex trailing argument patterns.
Scala developers building command-line applications, tools, or scripts that require structured argument parsing and validation.
Developers choose Scallop for its simplicity, extensive feature set, and cross-platform support across Scala versions, Scala Native, and Scala.js, making it a versatile choice for CLI development in the Scala ecosystem.
a simple Scala CLI parsing library
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Options and properties are parsed into non-string types using extendable converters, ensuring compile-time safety and reducing runtime errors, as highlighted in the type-safe parsing feature.
Features a backtracking parser for powerful matching on trailing args, distinguishing boundaries in argument lists, demonstrated in the 'fancy things' example with complex lists.
Supports not only subcommands but nested subcommands for complex CLI hierarchies, shown in the example with multiple nested Subcommand objects.
Cross-built for Scala 2.10+ and 3.7+, with support for Scala Native and Scala.js using %%% in SBT, making it suitable for diverse Scala targets.
Defining complex CLI structures, especially nested subcommands, requires verbose object definitions and manual addSubcommand calls, as seen in the subcommand example, which can increase boilerplate.
Migration notes for moving from 5.x to 6.x indicate that major version updates can introduce breaking changes, requiring code adjustments and potentially disrupting existing projects.
Tied to the Scala ecosystem, making it unsuitable for mixed-language projects or teams not committed to Scala, as it doesn't support other JVM languages directly.