Skip to content

Commit

Permalink
Improve docs, add package readme for extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
kzu committed Jun 25, 2024
1 parent 90333f1 commit c0d76db
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 52 deletions.
5 changes: 5 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<b><a href="#cli">CLI</a></b>
</p>

<!-- #content -->
# Why

`dotnet-config` (or `.netconfig`) provides a uniform mechanism for
Expand Down Expand Up @@ -339,6 +340,7 @@ You can explore the entire API in the [docs site](https://dotnetconfig.org/api/)
PM> Install-Package DotNetConfig.Configuration
```

<!-- #extensions -->
Usage (in this example, also chaining other providers):

```csharp
Expand Down Expand Up @@ -366,6 +368,8 @@ string port = config["serve:port"]; // == "8080";
string timeout = config["security:admin:timeout"]; // == "60";
```

<!-- #extensions -->

### System.CommandLine

[![Version](https://img.shields.io/nuget/v/DotNetConfig.CommandLine.svg?color=royalblue)](https://www.nuget.org/packages/DotNetConfig.CommandLine) [![Downloads](https://img.shields.io/nuget/dt/DotNetConfig.CommandLine.svg?color=darkmagenta)](https://www.nuget.org/packages/DotNetConfig.CommandLine)
Expand Down Expand Up @@ -543,4 +547,5 @@ all the following variants for arguments are supported: `-flag`, `--flag`, `/fla
`--flag value`, `/flag value`.
<!-- #cli -->
<!-- #content -->
<!-- include https://github.com/devlooped/sponsors/raw/main/footer.md -->
5 changes: 1 addition & 4 deletions src/CommandLine/CommandLine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ The following heuristics are applied when providing default values:
</PropertyGroup>

<ItemGroup>
<PackageReference Include="NuGetizer" Version="1.2.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="NuGetizer" Version="1.2.2" />
<PackageReference Include="Polyfill.NET" Version="1.0.12" PrivateAssets="all" />
<PackageReference Include="System.CommandLine" Version="2.0.0-beta1.21308.1" />
</ItemGroup>
Expand Down
37 changes: 2 additions & 35 deletions src/Config.Tool/Config.Tool.csproj
Original file line number Diff line number Diff line change
@@ -1,37 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Description>A global tool for managing hierarchical configurations for dotnet tools, using git config format.

Usage: dotnet config [options]

Location (uses all locations by default)
--local use .netconfig.user file
--global use global config file
--system use system config file
--path[=VALUE] use given config file or directory

Action
--get get value: name [value-regex]
--get-all get all values: key [value-regex]
--get-regexp get values for regexp: name-regex [value-regex]
--set set value: name value [value-regex]
--set-all set all matches: name value [value-regex]
--add add a new variable: name value
--unset remove a variable: name [value-regex]
--unset-all remove all matches: name [value-regex]
--remove-section remove a section: name
--rename-section rename section: old-name new-name
-l, --list list all
-e, --edit edit the config file in an editor

Other
--default[=VALUE] with --get, use default value when missing entry
--name-only show variable names only
--type[=VALUE] value is given this type, can be 'boolean', '
datetime' or 'number'
-?, -h, --help Display this help
</Description>
<Description>A global tool for managing hierarchical configurations for dotnet tools, using git config format.</Description>

<OutputType>Exe</OutputType>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
Expand All @@ -52,10 +22,7 @@ Other

<ItemGroup>
<PackageReference Include="Mono.Options" Version="6.12.0.148" />
<PackageReference Include="NuGetizer" Version="1.2.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="NuGetizer" Version="1.2.2" />
<PackageReference Include="ThisAssembly" Version="1.4.3" PrivateAssets="all" />
<PackageReference Include="Polyfill.NET" Version="1.0.12" PrivateAssets="all" />
</ItemGroup>
Expand Down
10 changes: 1 addition & 9 deletions src/Config/Config.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ Usage:
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Deterministic>true</Deterministic>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<PackageReadmeFile>readme.md</PackageReadmeFile>
</PropertyGroup>

<PropertyGroup Label="docfx">
Expand All @@ -33,18 +32,11 @@ Usage:
</PropertyGroup>

<ItemGroup>
<PackageReference Include="NuGetizer" Version="1.2.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="NuGetizer" Version="1.2.2" />
<PackageReference Include="System.Collections.Immutable" Version="6.0.0" />
<PackageReference Include="ThisAssembly" Version="1.4.3" PrivateAssets="all" />
<PackageReference Include="docfx.console" Version="2.59.4" PrivateAssets="all" />
<PackageReference Include="Polyfill.NET" Version="1.0.12" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
<None Include="..\..\readme.md" PackagePath="readme.md" Pack="true" Visible="false" />
</ItemGroup>

</Project>
3 changes: 3 additions & 0 deletions src/Config/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!-- include ../../readme.md#content -->
<!-- include https://github.com/devlooped/sponsors/raw/main/footer.md -->
<!-- exclude -->
11 changes: 7 additions & 4 deletions src/Configuration/Configuration.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,17 @@ Note: section is required and subsection is optional, just like in dotnet-config

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.1" />
<PackageReference Include="NuGetizer" Version="1.2.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="NuGetizer" Version="1.2.2" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Config\Config.csproj" />
</ItemGroup>

<ItemGroup>
<None Update="readme.md">
<PackagePath>%(Filename)%(Extension)</PackagePath>
</None>
</ItemGroup>

</Project>
3 changes: 3 additions & 0 deletions src/Configuration/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!-- include ../../readme.md#extensions -->
<!-- include https://github.com/devlooped/sponsors/raw/main/footer.md -->
<!-- exclude -->

0 comments on commit c0d76db

Please sign in to comment.