id = "split" name = "split" description = "Split a file into pieces." executables = ["split"] [commands] format = 1 label = "Split file" description = "Split a file by lines, bytes or pattern. Reads standard input when no file is given. Use only one of lines, bytes or pattern." quality = "ai-draft" base = "fig:split" 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/split.ts" license = "MIT" [[commands.field]] id = "file" label = "File to split" type = "path" position = 0 path = { kind = "file", role = "input" } sources = ["fig"] [[commands.field]] id = "prefix" label = "Output prefix" description = "Default is x." type = "string" position = 1 suggestions = [{ value = "x", label = "x" }] sources = ["fig"] [[commands.field]] id = "lines" label = "Lines per file" type = "integer" option = ["-l"] sources = ["fig"] [[commands.field]] id = "bytes" label = "Bytes per file" description = "A number with optional k, m or g suffix." type = "string" option = ["-b"] sources = ["fig"] [[commands.field]] id = "pattern" label = "Split at pattern" description = "Extended regular expression; the matching line starts the next file." type = "string" option = ["-p"] sources = ["fig"] [[commands.field]] id = "numeric" label = "Numeric suffixes" type = "boolean" option = ["-d"] sources = ["fig"] [[commands.field]] id = "suffix_len" label = "Suffix length" type = "integer" option = ["-a"] sources = ["fig"] [[commands.task]] id = "lines" label = "Split by lines" fields = ["file", "prefix", "lines", "numeric", "suffix_len"] required = ["file", "lines"] [[commands.task]] id = "bytes" label = "Split by size" fields = ["file", "prefix", "bytes", "numeric", "suffix_len"] required = ["file", "bytes"] [[commands.group]] id = "basic" label = "Basic" fields = ["file", "prefix", "lines", "bytes", "pattern", "numeric", "suffix_len"]