Skip to content

Commit

Permalink
Small documentation updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
SvenGroot committed Jul 20, 2023
1 parent 78ab0a3 commit bdbb5cc
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,20 @@ arguments; the only way was a third-party library, or do it yourself.
Nowadays, System.CommandLine offers an official Microsoft solution for command line parsing. Why,
then, should you use Ookii.CommandLine?

Ookii.CommandLine has a very different design. It uses a declarative approach to defining command
line arguments, using properties and attributes, which I personally prefer to the fluent API used
by System.CommandLine, as it reduces the amount of code you typically need to write.

In the end, it comes down to personal preference. You should use whichever one suits your needs and
coding style best.
Here are some of the most important differences (as of this writing, and to the best of my knowledge):

Ookii.CommandLine | System.CommandLine
------------------------------------------------------------------------------|---------------------------------------------------------------------------------------
Declarative approach to defining arguments with properties and attributes. | Fluent API with a builder pattern to define arguments.
Supports PowerShell-like and POSIX-like parsing rules. | Supports POSIX-like rules with some modifications.
Supports any type with a `Parse()` method or constructor that takes a string. | Supports a limited number of types, and requires custom conversion methods for others.
Supports automatic prefix aliases. | Does not support automatic prefix aliases.
Does not support middleware or dependency injection. | Supports middleware and dependency injection.
Fully released with a stable API between major releases. | Still in preview.

These are by no means the only differences. Both are highly customizable, and each has its pros and
cons. In the end, it mostly comes down to personal preference. You should use whichever one suits
your needs and coding style best.

## More information

Expand Down
1 change: 1 addition & 0 deletions docs/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ please check the [migration guide](Migrating.md).
to get full help.
- Exclude the default value from the usage help on a per argument basis with the
[`CommandLineArgumentAttribute.IncludeDefaultInUsageHelp`][] property.
- [Source link](https://github.com/dotnet/sourcelink) integration.
- Various bug fixes and minor improvements.

## Ookii.CommandLine 3.1.1
Expand Down
2 changes: 2 additions & 0 deletions license.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# MIT license

Copyright (c) Sven Groot (Ookii.org)

Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down

0 comments on commit bdbb5cc

Please sign in to comment.