feat: add semantic sorting and shortcuts to list-installed#1079
feat: add semantic sorting and shortcuts to list-installed#1079AshokThangavel wants to merge 12 commits intointersystems:mainfrom
Conversation
- Implement -sort (-s) for name, date, and version. - Fix version collation using numeric $List segments (e.g., 0.10 > 0.2). - Add descending order support via -desc suffix (e.g., v-d, d-d). - Support power-user shortforms (n, d, v) for all sort modes. - Update help documentation with usage examples.
isc-dchui
left a comment
There was a problem hiding this comment.
Just a few minor things. Thanks for tackling this and all the other issues! I promise to actually get your changes merged once we've sorted out all this IPM regression instability. (We're almost there...)
|
@AshokThangavel I think you also need to pull from main here to resolve merge conflicts |
|
I’ve pulled the latest changes from main and resolved the conflicts in CHANGELOG.md. The new entry has been updated to |
…kThangavel/ipm into feat/list-installed-sorting
…kThangavel/ipm into feat/list-installed-sorting
…or with identical versions were overwriting each other by introducing a new subscript to differentiate them
isc-kiyer
left a comment
There was a problem hiding this comment.
@AshokThangavel few small notes
| <modifier name="showupstream" aliases="su" description="If specified, show the latest version for each module in configured repos if it's different than the local version." /> | ||
| <modifier name="repository" aliases="repo" value="true" description="If specified, only show modules installed that belong to the provided repository." /> | ||
| <modifier name="python" aliases="py" description="If specified, lists installed Embedded Python libraries instead of IPM modules." /> | ||
| <modifier name="sort" aliases="s" value="true" description="Sort the list. Options: name, name-desc, date, date-desc, version, version-desc" /> |
There was a problem hiding this comment.
Default sort (if flag not provided) should be ascending by name. Should indicate that here.
| set ..Version = pResolvedReference.Version | ||
| set ..Deployed = pResolvedReference.Deployed | ||
| set ..PlatformVersions = pResolvedReference.PlatformVersions | ||
| set ..VersionString = pResolvedReference.VersionString |
There was a problem hiding this comment.
This seems like a mistake in merging from main. These should not be removed.
| { | ||
| do $$$LogMessage("Testing list-installed sorting flags") | ||
| set status = ..RunCommand("list") | ||
| set status = ..RunCommand("list -s n") |
There was a problem hiding this comment.
Tests should read output and confirm its sorted in the correct order. Should also test ascending and descending for each sort modifier
Enhanced Sorting for
list-installedOverview
This PR introduces a new
-sort(shortcut-s) modifier to thelist-installedcommand. It allows users to organize their installed modules by Name, Installation Date, or Semantic Version, significantly improving manageability for environments with many packagesfixes: #1071
Features Added
Three New Sort Modes:
name: Alphabetical sorting (case-insensitive).date: Chronological sorting based on when the module was installed.version: Semantic version sorting (handling Major.Minor.Patch logic).Descending Order Support: Added a
-desc(or-d) suffix to all sort modes to reverse the output.Power-User Shortcuts: Implemented shorthand notation for faster CLI usage:
n,n-d(Name)d,d-d(Date)v,v-d(Version)Testing Performed
Verified all combinations of sort keys and directions via the ZPM shell:
list -s v-dcorrectly places version4.1.2above1.0.1.list -s d-dplaces the most recently installed module at the top.list -s n-d) resolve correctly to their full counterparts.