CommandConfiguration currently has a listing of subcommands. For swift package, it's a pretty long list:
subcommands: [
AddDependency.self,
AddProduct.self,
AddTarget.self,
AddTargetDependency.self,
Clean.self,
PurgeCache.self,
Reset.self,
Update.self,
Describe.self,
Init.self,
Format.self,
Install.self,
Uninstall.self,
APIDiff.self,
DeprecatedAPIDiff.self,
DumpSymbolGraph.self,
DumpPIF.self,
DumpPackage.self,
Edit.self,
Unedit.self,
Config.self,
Resolve.self,
Fetch.self,
ShowDependencies.self,
ToolsVersionCommand.self,
ComputeChecksum.self,
ArchiveSource.self,
CompletionCommand.self,
PluginCommand.self,
DefaultCommand.self,
]
We could introduce some group structure with another argument, e.g.,
subgroups: [
CommandGroup(
name: "Package manifest editing",
subcommands: [
AddDependency.self,
AddProduct.self,
AddTarget.self,
AddTargetDependency.self,
Init.self,
]
),
CommandGraph(
name: "Package editing",
subcommands: [
Edit.self,
Unedit.self,
]
),
]
Under this suggestion, swift package target will have two entries, and swift package product will have one. There will be no consistent place for "package manifest editing operations" the way the grouping described above provides.
I think the hierarchy sounds attractive because it feels right to put things into hierarchies, but I don't think it's actually going to actually make anything easier for people.
Doug