Skip to content

Commit 78dba0e

Browse files
committed
Use @ instead of / for separating package name and version
1 parent a0655fe commit 78dba0e

File tree

5 files changed

+23
-10
lines changed

5 files changed

+23
-10
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,19 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
77
## [Unreleased][Unreleased]
88

99
* Fixed a bug where `nugraph` could fail with `InvalidProjectFileException` if run from a directory containing a `Directory.Build.props` file.
10+
* Use `@` instead of `/` for separating package name and version.
11+
12+
Before:
13+
14+
```shell
15+
nugraph Newtonsoft.Json/12.0.3
16+
```
17+
18+
After:
19+
20+
```shell
21+
nugraph Newtonsoft.Json@12.0.3
22+
```
1023

1124
## [0.5.0][0.5.0] - 2025-06-27
1225

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ dotnet tool install --global nugraph
104104

105105
Run `nugraph <NuGetPackageName>` to generate the dependency graph of a NuGet package. For example, run `nugraph Serilog.Sinks.File` to generate the dependency graph of the [Serilog.Sinks.File](https://www.nuget.org/packages/Serilog.Sinks.File) package.
106106

107-
A specific version can be explicitly requested by appending **/version** to the package name, for example `nugraph Serilog.Sinks.File/4.1.0`. When no version is specified, the latest version available on NuGet is chosen.
107+
A specific version can be explicitly requested by appending **@version** to the package name, for example `nugraph Serilog.Sinks.File@4.1.0`. When no version is specified, the latest version available on NuGet is chosen.
108108

109109
Many packages support multiple target frameworks and sometimes the dependencies varies across different target frameworks. A target framework is guessed automatically, but it can be overriden with the `-f` or `--framework` option.
110110

src/nugraph/GraphCommandSettings.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ internal sealed class GraphCommandSettings : CommandSettings
3232
[CommandArgument(0, "[SOURCE]")]
3333
[Description("The source of the graph\n" +
3434
"Can be either\n" +
35-
" * the name of a NuGet package, optionally with a specific version, e.g. [b]Newtonsoft.Json/13.0.3[/]\n" +
35+
" * the name of a NuGet package, optionally with a specific version, e.g. [b]Newtonsoft.Json@13.0.3[/]\n" +
3636
" * a .NET project file (csproj/fsproj/vbproj)\n" +
3737
" * a directory containing a single .NET project\n")]
3838
public string? SourceInput { get; init; }
@@ -233,7 +233,7 @@ private static OnlineService GetOnlineService(string fmt)
233233

234234
private static PackageIdentity GetPackageIdentity(string packageId)
235235
{
236-
var parts = packageId.Split('/');
236+
var parts = packageId.Split('@');
237237
if (parts.Length == 2)
238238
{
239239
if (NuGetVersion.TryParse(parts[1], out var version))

src/nugraph/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public async Task<int> RunAsync(params string[] args)
3838
{
3939
config.AddExample("spectre.console/src/Spectre.Console.Cli/Spectre.Console.Cli.csproj", "--include-version");
4040
config.AddExample("Serilog.Sinks.MSSqlServer", "--ignore", "Microsoft.Data.SqlClient", "--ignore", "\"System.*\"");
41-
config.AddExample("Newtonsoft.Json/12.0.3", "--framework", "netstandard1.0");
41+
config.AddExample("Newtonsoft.Json@12.0.3", "--framework", "netstandard1.0");
4242
config.AddExample("Azure.Core", "--direction", "TopToBottom", "--output", "Azure.Core.gv");
4343
config.AddExample("Polly", "--format", "dot", "--title", "\"\"");
4444
#if DEBUG

tests/nugraph.Tests/NugraphTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,17 +79,17 @@ public async Task Package_Serilog_WorkingDirectoryUsingArcadeSdk()
7979
}
8080

8181
[Test]
82-
public async Task Package_Serilog_430_net60()
82+
public async Task Package_Serilog_401_net60()
8383
{
84-
var result = await nugraph.RunAsync(["Serilog/4.3.0", "--framework", "net6.0"]);
84+
var result = await nugraph.RunAsync(["Serilog@4.0.1", "--framework", "net6.0"]);
8585

8686
result.Should().Match(stdOutPattern: "https://mermaid.live/view#pako:*", stdErrPattern: """
87-
Generating dependency graph for Serilog 4.3.0
88-
Generating dependency graph for Serilog 4.3.0 (net6.0)
87+
Generating dependency graph for Serilog 4.0.1
88+
Generating dependency graph for Serilog 4.0.1 (net6.0)
8989
""")
9090
.And.UrlHasDiagram("""
9191
---
92-
title: Dependency graph of Serilog 4.3.0 (net6.0)
92+
title: Dependency graph of Serilog 4.0.1 (net6.0)
9393
---
9494
9595
%% Generated by https://github.com/0xced/nugraph
@@ -103,7 +103,7 @@ graph LR
103103
104104
class Serilog root
105105
class Serilog default
106-
click Serilog "https://www.nuget.org/packages/Serilog/4.3.0" "Serilog 4.3.0"
106+
click Serilog "https://www.nuget.org/packages/Serilog/4.0.1" "Serilog 4.0.1"
107107
""");
108108
}
109109

0 commit comments

Comments
 (0)