22using System . Collections . Generic ;
33using System . Diagnostics ;
44using System . Diagnostics . CodeAnalysis ;
5- using System . Globalization ;
65using System . IO ;
76using System . Linq ;
87using System . Reflection ;
9- using System . Runtime . InteropServices ;
108using System . Text ;
119using System . Threading ;
1210using System . Threading . Tasks ;
1513using Mono . Options ;
1614using Spectre . Console ;
1715using Spectre . Console . Rendering ;
18- using static Devlooped . SponsorLink ;
1916using static ThisAssembly . Strings ;
2017
2118namespace NuGetize ;
@@ -396,7 +393,7 @@ void AddContents(TreeNode node, List<XElement> contents)
396393 }
397394
398395 if ( attributes . Count > 0 )
399- parent . AddNode ( $ "[white]{ Path . GetFileName ( file ) } [/] [grey]({ string . Join ( ',' , attributes ) } )[/]") ;
396+ parent . AddNode ( $ "[white]{ Path . GetFileName ( file ) } [/] [grey]({ string . Join ( ", " , attributes ) } )[/]") ;
400397 else
401398 parent . AddNode ( $ "[white]{ Path . GetFileName ( file ) } [/]") ;
402399 }
@@ -413,7 +410,16 @@ void AddDependencies(Tree root, List<XElement> dependencies)
413410 var tf = deps . AddNode ( $ "[green]{ group . Key } [/]") ;
414411 foreach ( var dependency in group )
415412 {
416- tf . AddNode ( Markup . FromInterpolated ( $ "[white]{ dependency . Attribute ( "Include" ) . Value } [/], [grey]{ dependency . Element ( "Version" ) . Value } [/]") ) ;
413+ var attributes = new List < string > ( ) ;
414+ if ( dependency . Element ( "PackInclude" ) ? . Value is string include && ! string . IsNullOrEmpty ( include ) )
415+ attributes . Add ( "include=" + include ) ;
416+ if ( dependency . Element ( "PackExclude" ) ? . Value is string exclude && ! string . IsNullOrEmpty ( exclude ) )
417+ attributes . Add ( "exclude=" + exclude ) ;
418+
419+ if ( attributes . Count > 0 )
420+ tf . AddNode ( Markup . FromInterpolated ( $ "[white]{ dependency . Attribute ( "Include" ) . Value } [/], [grey]{ dependency . Element ( "Version" ) . Value } [/] [grey]({ string . Join ( ", " , attributes ) } )[/]") ) ;
421+ else
422+ tf . AddNode ( Markup . FromInterpolated ( $ "[white]{ dependency . Attribute ( "Include" ) . Value } [/], [grey]{ dependency . Element ( "Version" ) . Value } [/]") ) ;
417423 }
418424 }
419425 }
0 commit comments