Skip to content

Latest commit

 

History

History
99 lines (90 loc) · 7.96 KB

Migrating.md

File metadata and controls

99 lines (90 loc) · 7.96 KB

Migrating from Ookii.CommandLine 2.x

Ookii.CommandLine 3.0 and later have a number of breaking changes from version 2.4 and earlier versions. This article explains what you need to know to migrate your code to the new version.

Although there are quite a few changes, it's likely your application will not require many modifications unless you used subcommands or heavily customized the usage help format.

.Net Framework support

As of version 3.0, .Net Framework 2.0 is no longer supported. You can still target .Net Framework 4.6.1 and later using the .Net Standard 2.0 assembly. If you need to support an older version of .Net, please continue to use version 2.4.

Breaking API changes

Breaking behavior changes

  • Argument type conversion now defaults to CultureInfo.InvariantCulture, instead of CurrentCulture. This change was made to ensure a consistent parsing experience regardless of the user's regional settings. Only change it if you have a good reason.
  • CommandLineParser automatically adds -Help and -Version arguments by default. If you had arguments with these names, this will not affect you. The -Version argument is not added for subcommands.
  • CommandManager automatically adds a version command by default. If you had a command with this name, this will not affect you.
  • The usage help now includes aliases and default values by default.
  • The default format for showing aliases in the usage help has changed.
  • Usage help uses color output by default (where supported).
  • The LineWrappingTextWriter class does not count virtual terminal sequences as part of the line length by default.