mirror of
https://github.com/Pmodules/Pmodules.git
synced 2026-06-28 10:29:37 +02:00
modulecmd: sort output of sub-command avail numerically
This commit is contained in:
@@ -972,6 +972,8 @@ subcommand_avail() {
|
||||
(( n > max_length )) && (( max_length=n ))
|
||||
available_modules+=("${mod}")
|
||||
done
|
||||
IFS=$'\n' available_modules=($(sort --version-sort <<<"${available_modules[*]}"))
|
||||
unset IFS
|
||||
local -i span=$(( max_length / 16 + 1 )) # compute column size
|
||||
local -i colsize=$(( span * 16 )) # as multiple of 16
|
||||
local -i column=$cols # force a line-break
|
||||
|
||||
Reference in New Issue
Block a user