id = "tar" name = "tar" description = "tar creates, lists and extracts archive files." executables = ["tar"] [commands] format = 1 label = "Archive files" description = "Create, list or extract a tar archive. Choose a job in the subcommand tabs; less common options (incremental backups, multi-volume, ACLs, pax options) are left out." quality = "ai-draft" base = "fig:tar" 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/tar.ts" license = "MIT" [[commands.subcommand]] path = ["c"] label = "Create archive" description = "Pack files and directories into a new archive. Compression is chosen by flag." parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = true } [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/tar.ts" license = "MIT" [[commands.subcommand.field]] id = "archive" label = "Archive file" type = "path" option = ["-f", "--file"] path = { kind = "file", role = "output" } effect = "overwrite" min = 1 sources = ["fig"] [[commands.subcommand.field]] id = "gzip" label = "gzip compression" type = "boolean" option = ["-z", "--gzip"] sources = ["fig"] [[commands.subcommand.field]] id = "bzip2" label = "bzip2 compression" type = "boolean" option = ["-j", "--bzip2"] sources = ["fig"] [[commands.subcommand.field]] id = "xz" label = "xz compression" type = "boolean" option = ["-J", "--xz"] sources = ["fig"] [[commands.subcommand.field]] id = "zstd" label = "zstd compression" type = "boolean" option = ["--zstd"] sources = ["fig"] [[commands.subcommand.field]] id = "verbose" label = "Verbose" type = "boolean" option = ["-v", "--verbose"] sources = ["fig"] [[commands.subcommand.field]] id = "exclude" label = "Exclude patterns" type = "string" option = ["--exclude"] multiple = true sources = ["fig"] [[commands.subcommand.field]] id = "exclude_vcs" label = "Exclude VCS directories" type = "boolean" option = ["--exclude-vcs"] sources = ["fig"] [[commands.subcommand.field]] id = "dereference" label = "Follow symlinks" type = "boolean" option = ["-h", "--dereference"] sources = ["fig"] [[commands.subcommand.field]] id = "files" label = "Files and directories" type = "path" position = 0 multiple = true min = 1 path = { kind = "any", role = "input", must_exist = true } sources = ["fig"] [[commands.subcommand.task]] id = "targz" label = "Create .tar.gz" fields = ["archive", "gzip", "files"] required = ["archive", "files"] set = { gzip = [true] } [[commands.subcommand.task]] id = "tarxz" label = "Create .tar.xz" fields = ["archive", "xz", "files"] required = ["archive", "files"] set = { xz = [true] } [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["archive", "files", "gzip", "bzip2", "xz", "zstd", "verbose"] [[commands.subcommand.group]] id = "advanced" label = "Advanced" fields = ["exclude", "exclude_vcs", "dereference"] [[commands.subcommand]] path = ["x"] label = "Extract archive" description = "Unpack an archive into a directory. Existing files are replaced unless a keep option is set." parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = true } [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/tar.ts" license = "MIT" [[commands.subcommand.field]] id = "archive" label = "Archive file" type = "path" option = ["-f", "--file"] path = { kind = "file", role = "input", must_exist = true } min = 1 sources = ["fig"] [[commands.subcommand.field]] id = "directory" label = "Extract into directory" type = "path" option = ["-C", "--directory"] path = { kind = "directory", role = "output" } sources = ["fig"] [[commands.subcommand.field]] id = "verbose" label = "Verbose" type = "boolean" option = ["-v", "--verbose"] sources = ["fig"] [[commands.subcommand.field]] id = "strip_components" label = "Strip leading path components" type = "integer" option = ["--strip-components"] sources = ["fig"] [[commands.subcommand.field]] id = "keep_old" label = "Keep existing files" type = "boolean" option = ["-k", "--keep-old-files"] sources = ["fig"] [[commands.subcommand.field]] id = "preserve_permissions" label = "Preserve permissions" type = "boolean" option = ["-p", "--preserve-permissions"] sources = ["fig"] [[commands.subcommand.field]] id = "to_stdout" label = "Write to standard output" type = "boolean" option = ["-O", "--to-stdout"] sources = ["fig"] [[commands.subcommand.field]] id = "members" label = "Only these members" description = "Leave empty to extract everything." type = "string" position = 0 multiple = true sources = ["fig"] [[commands.subcommand.task]] id = "extract_all" label = "Extract everything" fields = ["archive", "directory"] required = ["archive"] [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["archive", "directory", "verbose", "members"] [[commands.subcommand.group]] id = "advanced" label = "Advanced" fields = ["strip_components", "keep_old", "preserve_permissions", "to_stdout"] [[commands.subcommand]] path = ["t"] label = "List archive" description = "List the members of an archive without extracting." parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = true } [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/tar.ts" license = "MIT" [[commands.subcommand.field]] id = "archive" label = "Archive file" type = "path" option = ["-f", "--file"] path = { kind = "file", role = "input", must_exist = true } min = 1 sources = ["fig"] [[commands.subcommand.field]] id = "verbose" label = "Verbose (long listing)" type = "boolean" option = ["-v", "--verbose"] sources = ["fig"] [[commands.subcommand.task]] id = "list" label = "List contents" fields = ["archive", "verbose"] required = ["archive"] [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["archive", "verbose"]