Commit Graph
6 Commits
Author SHA1 Message Date
Rauhul Varma 00a86771ca Clean up help generation (#385)
- Adds check to ensure that `wrapped(to:wrappingIndent:)` doesn't
  attempt to retrieve a negative prefix.
- The Usage struct was composed of an array of strings which always
  contained exact one string at runtime. This struct has been removed
  and replaced with a single usage string.
- Removes HelpGenerator._screenWidthOverride in favor of explicitly
  setting the screen width in generateHelp calls.
2022-01-10 16:02:50 -06:00
Nate Cook 280700d361 Add completion script generation (#123)
Support for generating shell completion scripts for `ParsableCommand`
types, with customization points for `ExpressibleByArgument` types and
individual arguments and options. Zsh and Bash are supported in this
initial release.
2020-07-29 17:58:44 -05:00
Aleksey Mashanov df24620865 Fix invalid indention of strings with short lines (#148) 2020-05-16 12:39:56 -05:00
Yu Ao 2f7e13ae2a Simplify the implementation of String.convertedToSnakeCase (#81)
* Add tests for String.convertedToSnakeCase

* Simplify the implementation of String.convertedToSnakeCase
2020-03-16 09:41:24 -05:00
Klaas Pieter Annema fd5b49c8dc Provide suggestions for unknown options (#10)
* Add String#editDistance(to:)

Uses levenshtein distance to determine how much two strings differ.

See: https://en.wikipedia.org/wiki/Levenshtein_distance

* Simplify unknownOptionMessage

The logic of Name#synopsisString was repeated in unknownOptionMessage.
This change sit so that unknownOptionMessage defer to Name's
implementation instead.

* Provide suggestions for unknown options
2020-03-02 11:21:03 -06:00
Nate Cook f6ac7b8118 Initial import of ArgumentParser 2020-02-27 15:45:22 -06:00