id = "sort" name = "sort" description = "Sort or merge records (lines) of text files." executables = ["sort"] [commands] format = 1 label = "Sort lines" description = "Sort lines of files or standard input. Check mode, sort algorithms, memory and compression options are not included." quality = "ai-draft" base = "fig:sort" parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = true } [[commands.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/sort.ts" license = "MIT" [[commands.field]] id = "files" label = "Input files" description = "Leave empty to read standard input." type = "path" position = 0 multiple = true path = { kind = "file", role = "input" } sources = ["fig"] [[commands.field]] id = "output" label = "Output file" type = "path" option = ["--output", "-o"] path = { kind = "file", role = "output" } effect = "overwrite" sources = ["fig"] [[commands.field]] id = "reverse" label = "Reverse order" type = "boolean" option = ["--reverse", "-r"] sources = ["fig"] [[commands.field]] id = "numeric" label = "Numeric sort" type = "boolean" option = ["--numeric-sort", "-n"] sources = ["fig"] [[commands.field]] id = "human" label = "Human-numeric sort" description = "Understands SI suffixes such as 2K and 1G." type = "boolean" option = ["--human-numeric-sort", "-h"] sources = ["fig"] [[commands.field]] id = "general" label = "General numeric sort" type = "boolean" option = ["--general-numeric-sort", "-g"] sources = ["fig"] [[commands.field]] id = "version" label = "Version sort" type = "boolean" option = ["--version-sort", "-V"] sources = ["fig"] [[commands.field]] id = "month" label = "Month sort" type = "boolean" option = ["--month-sort", "-M"] sources = ["fig"] [[commands.field]] id = "random" label = "Random order" type = "boolean" option = ["--random-sort", "-R"] sources = ["fig"] [[commands.field]] id = "unique" label = "Unique lines only" type = "boolean" option = ["--unique", "-u"] sources = ["fig"] [[commands.field]] id = "ignore_case" label = "Ignore case" type = "boolean" option = ["--ignore-case", "-f"] sources = ["fig"] [[commands.field]] id = "blanks" label = "Ignore leading blanks" type = "boolean" option = ["--ignore-leading-blanks", "-b"] sources = ["fig"] [[commands.field]] id = "dict" label = "Dictionary order" type = "boolean" option = ["--dictionary-order", "-d"] sources = ["fig"] [[commands.field]] id = "stable" label = "Stable sort" type = "boolean" option = ["-s"] sources = ["fig"] [[commands.field]] id = "merge" label = "Merge pre-sorted files" type = "boolean" option = ["--merge", "-m"] sources = ["fig"] [[commands.field]] id = "zero" label = "NUL-terminated records" type = "boolean" option = ["--zero-terminated", "-z"] sources = ["fig"] [[commands.field]] id = "key" label = "Sort key" description = "Field position such as 2 or 2,2." type = "string" option = ["--key", "-k"] sources = ["fig"] [[commands.field]] id = "sep" label = "Field separator" description = "A single character." type = "string" option = ["--field-separator", "-t"] sources = ["fig"] [[commands.field]] id = "tmpdir" label = "Temporary directory" type = "string" option = ["--temporary-directory", "-T"] sources = ["fig"] [[commands.task]] id = "sort" label = "Sort lines" fields = ["files", "reverse", "unique", "ignore_case", "output"] required = [] [[commands.task]] id = "numeric" label = "Sort numerically" fields = ["files", "numeric", "reverse", "unique", "key", "sep", "output"] required = [] set = { numeric = [true] } lock = ["numeric"] [[commands.task]] id = "by-column" label = "Sort by column" fields = ["files", "key", "sep", "numeric", "reverse", "output"] required = ["key"] [[commands.group]] id = "basic" label = "Basic" fields = ["files", "reverse", "numeric", "unique", "ignore_case", "key", "sep", "output"] [[commands.group]] id = "advanced" label = "Advanced" fields = ["human", "general", "version", "month", "random", "blanks", "dict", "stable", "merge", "zero", "tmpdir"]