Skip to content

Commit

Permalink
Sort (optional) repository list in status output
Browse files Browse the repository at this point in the history
  • Loading branch information
asherikov committed Dec 9, 2024
1 parent fda5aef commit cef7e66
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ wrap_test:
test_update:
${WSHANDLER} -t ${TYPE} --root tests/update/ clean
${WSHANDLER} -t ${TYPE} -r tests/update/ status
${WSHANDLER} -t ${TYPE} -r tests/update/ -u status
${WSHANDLER} -t ${TYPE} -r tests/update/ --jobs 2 update
${WSHANDLER} -t ${TYPE} --root tests/update/ status
${WSHANDLER} -t ${TYPE} --root tests/update/ -j 2 clean
Expand Down
9 changes: 7 additions & 2 deletions wshandler
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ help()
echo ""
echo "List commands:"
echo " Information:"
echo " status"
echo " [-u|--unsorted] status"
echo " is_source_space"
echo " Initialization:"
echo " [-p|--policy <POLICY1[,POLICY2]> ({default}|shallow|nolfs)] clone git <LIST_REPOSITORY> [<BRANCH>]"
Expand Down Expand Up @@ -104,7 +104,7 @@ git_status()
DATA=$(
echo "name|version|actual version|HM|repository";
echo "----|-------|--------------|--|----------";
"${WSH_WORKSPACE_TYPE}_git_repo_triplets" | while read -r -a TRIPLET; do dir_git_status "${TRIPLET[@]}"; done
"${WSH_WORKSPACE_TYPE}_git_repo_triplets" | while read -r -a TRIPLET; do dir_git_status "${TRIPLET[@]}"; done | "${WSH_SORT_COMMAND}"
)

FORMAT_STRING=""
Expand Down Expand Up @@ -725,6 +725,7 @@ WSH_KEEP_GOING=""
WSH_YQ_BINARY="yq"
WSH_SOURCE_TYPE="git"
WSH_REPOLIST=
WSH_SORT_COMMAND=sort

while [[ $# -gt 0 ]]
do
Expand Down Expand Up @@ -779,6 +780,10 @@ do
WSH_REPOLIST=$2
shift; shift;;

-u|--unsorted)
WSH_SORT_COMMAND=cat
shift;;

clone|init)
"execute_$1" "${@:2}"
exit;;
Expand Down

0 comments on commit cef7e66

Please sign in to comment.