diff --git a/bin/cosmic-roster b/bin/cosmic-roster index 57a65db..20795ea 100755 --- a/bin/cosmic-roster +++ b/bin/cosmic-roster @@ -17,9 +17,10 @@ do printf "%s|%s\\n" "$owner" "$(basename "$shipdir")" >> "$temp_roster" done - -if [ "$1" = "count" ]; then +if [ "$#" -ne 1 ]; then + sort "$temp_roster" | column -s "|" -t +elif [ "$1" = "count" ]; then sort "$temp_roster" | awk 'FS="|" {print $1}' | uniq -c else - sort "$temp_roster" | column -s "|" -t + sort "$temp_roster" | column -s "|" -t | grep "$*" fi