Documentation
¶
Index ¶
Constants ¶
View Source
const ( SortReverse sortReverseFlag = true SortNoReverse sortReverseFlag = false )
View Source
const ( SortNumeric sortNumericFlag = true SortNoNumeric sortNumericFlag = false )
View Source
const ( SortUnique sortUniqueFlag = true SortNoUnique sortUniqueFlag = false )
View Source
const ( SortIgnoreCase sortIgnoreCaseFlag = true SortCaseSensitive sortIgnoreCaseFlag = false )
View Source
const ( SortRandom sortRandomFlag = true SortNoRandom sortRandomFlag = false )
View Source
const ( SortIgnoreLeadingBlanks sortIgnoreLeadingBlanksFlag = true SortNoIgnoreLeadingBlanks sortIgnoreLeadingBlanksFlag = false )
View Source
const ( SortVersionSort sortVersionSortFlag = true SortNoVersionSort sortVersionSortFlag = false )
View Source
const ( SortHumanNumeric sortHumanNumericFlag = true SortNoHumanNumeric sortHumanNumericFlag = false )
View Source
const ( SortMonthSort sortMonthSortFlag = true SortNoMonthSort sortMonthSortFlag = false )
View Source
const ( SortStableSort sortStableSortFlag = true SortNoStableSort sortStableSortFlag = false )
Variables ¶
This section is empty.
Functions ¶
func Sort ¶
Sort returns a Command that sorts input lines, GNU sort style.
Flags:
- SortReverse (-r): reverse the comparison
- SortNumeric (-n): compare by leading numeric value
- SortHumanNumeric (-h): compare human sizes (2K < 1M)
- SortMonthSort (-M): compare month names (Jan < Feb)
- SortVersionSort (-V): natural/version compare (v1.2 < v1.10)
- SortUnique (-u): drop adjacent duplicate keys
- SortIgnoreCase (-f): fold case before comparing
- SortIgnoreLeadingBlanks (-b): trim leading blanks before comparing
- SortField (-k) with SortDelimiter (-t): compare a single field
- SortStableSort (-s): preserve input order of equal keys
- SortRandom (-R): shuffle instead of sort
Types ¶
type SortDelimiter ¶
type SortDelimiter string
const ( SortDelimiterColon SortDelimiter = ":" SortDelimiterComma SortDelimiter = "," SortDelimiterDash SortDelimiter = "-" SortDelimiterDot SortDelimiter = "." SortDelimiterHash SortDelimiter = "#" SortDelimiterSemicolon SortDelimiter = ";" SortDelimiterSlash SortDelimiter = "/" SortDelimiterSpace SortDelimiter = " " SortDelimiterTab SortDelimiter = "\t" )
Click to show internal directories.
Click to hide internal directories.