{
    "mode": "man",
    "parameter": "WRAP-AND-SORT",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/WRAP-AND-SORT/1/json",
    "generated": "2026-09-01T17:48:32Z",
    "synopsis": "wrap-and-sort [options]",
    "sections": {
        "NAME": {
            "content": "wrap-and-sort - wrap long lines and sort items in Debian packaging files\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "wrap-and-sort [options]\n\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "wrap-and-sort wraps the package lists in Debian control files. By default the lists will only\nsplit  into multiple lines if the entries are longer than the maximum line length limit of 79\ncharacters. wrap-and-sort sorts the package lists in Debian  control  files  and  all  .dirs,\n.docs,  .examples,  .info,  .install,  .links, .maintscript, and .manpages files. Beside that\nwrap-and-sort removes trailing spaces in these files.\n\nThis script should be run in the root of a Debian package tree. It searches for control, con‐\ntrol*.in, copyright, copyright.in, install, and *.install in the debian directory.\n\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-h --help",
                    "content": "Show this help message and exit.\n",
                    "flag": "-h",
                    "long": "--help"
                },
                {
                    "name": "-a --wrap-always",
                    "content": "Wrap all package lists in the Debian control file even if they do not exceed the  line\nlength limit and could fit in one line.\n",
                    "flag": "-a",
                    "long": "--wrap-always"
                },
                {
                    "name": "-s --short-indent",
                    "content": "Only indent wrapped lines by one space (default is in-line with the field name).\n",
                    "flag": "-s",
                    "long": "--short-indent"
                },
                {
                    "name": "-b --sort-binary-packages",
                    "content": "Sort binary package paragraphs by name.\n",
                    "flag": "-b",
                    "long": "--sort-binary-packages"
                },
                {
                    "name": "-k --keep-first",
                    "content": "When sorting binary package paragraphs, leave the first one at the top.\n\nUnqualified debhelper(7) configuration files are applied to the first package.\n",
                    "flag": "-k",
                    "long": "--keep-first"
                },
                {
                    "name": "--no-keep-first",
                    "content": "When  sorting binary package paragraphs, do not treat the first package specially (op‐\nposite of --keep-first)\n",
                    "long": "--no-keep-first"
                },
                {
                    "name": "-n --no-cleanup",
                    "content": "Do not remove trailing whitespaces.\n",
                    "flag": "-n",
                    "long": "--no-cleanup"
                },
                {
                    "name": "-t --trailing-comma",
                    "content": "Add a trailing comma at the end of the sorted fields.  This minimizes  future  differ‐\nences in the VCS commits when additional dependencies are appended or removed.\n",
                    "flag": "-t",
                    "long": "--trailing-comma"
                },
                {
                    "name": "-d _ --debian-directory=_",
                    "content": "Location of the debian directory (default: ./debian).\n",
                    "flag": "-d",
                    "long": "--debian-directory",
                    "arg": "_"
                },
                {
                    "name": "-f _ --file=_",
                    "content": "Wrap and sort only the specified file.  You can specify this parameter multiple times.\nAll supported files will be processed if no files are specified.\n",
                    "flag": "-f",
                    "long": "--file",
                    "arg": "_"
                },
                {
                    "name": "-v --verbose",
                    "content": "Print all files that are touched.\n\n--max-line-length=maxlinelength\nSet the maximum allowed line length. Package lists in the Debian control file that ex‐\nceed this length limit will be wrapped.\n\nThe default maximum line length is 79 characters.\n",
                    "flag": "-v",
                    "long": "--verbose"
                },
                {
                    "name": "-N --dry-run",
                    "content": "Do not modify any file, instead only print the files that would be modified.\n\n",
                    "flag": "-N",
                    "long": "--dry-run"
                },
                {
                    "name": "--experimental-rts-parser",
                    "content": "Temporary option accepted for compatibility with an experiment. It no longer does any‐\nthing. Please remove any use of it.\n\n",
                    "long": "--experimental-rts-parser"
                }
            ]
        },
        "AUTHORS": {
            "content": "wrap-and-sort and this manpage have been written by Benjamin Drung <bdrung@debian.org>.\n\nBoth are released under the ISC license.\n\nDEBIAN                                    Debian Utilities                          WRAP-AND-SORT(1)",
            "subsections": []
        }
    },
    "summary": "wrap-and-sort - wrap long lines and sort items in Debian packaging files",
    "flags": [
        {
            "flag": "-h",
            "long": "--help",
            "arg": null,
            "description": "Show this help message and exit."
        },
        {
            "flag": "-a",
            "long": "--wrap-always",
            "arg": null,
            "description": "Wrap all package lists in the Debian control file even if they do not exceed the line length limit and could fit in one line."
        },
        {
            "flag": "-s",
            "long": "--short-indent",
            "arg": null,
            "description": "Only indent wrapped lines by one space (default is in-line with the field name)."
        },
        {
            "flag": "-b",
            "long": "--sort-binary-packages",
            "arg": null,
            "description": "Sort binary package paragraphs by name."
        },
        {
            "flag": "-k",
            "long": "--keep-first",
            "arg": null,
            "description": "When sorting binary package paragraphs, leave the first one at the top. Unqualified debhelper(7) configuration files are applied to the first package."
        },
        {
            "flag": "",
            "long": "--no-keep-first",
            "arg": null,
            "description": "When sorting binary package paragraphs, do not treat the first package specially (op‐ posite of --keep-first)"
        },
        {
            "flag": "-n",
            "long": "--no-cleanup",
            "arg": null,
            "description": "Do not remove trailing whitespaces."
        },
        {
            "flag": "-t",
            "long": "--trailing-comma",
            "arg": null,
            "description": "Add a trailing comma at the end of the sorted fields. This minimizes future differ‐ ences in the VCS commits when additional dependencies are appended or removed."
        },
        {
            "flag": "-d",
            "long": "--debian-directory",
            "arg": "_",
            "description": "Location of the debian directory (default: ./debian)."
        },
        {
            "flag": "-f",
            "long": "--file",
            "arg": "_",
            "description": "Wrap and sort only the specified file. You can specify this parameter multiple times. All supported files will be processed if no files are specified."
        },
        {
            "flag": "-v",
            "long": "--verbose",
            "arg": null,
            "description": "Print all files that are touched. --max-line-length=maxlinelength Set the maximum allowed line length. Package lists in the Debian control file that ex‐ ceed this length limit will be wrapped. The default maximum line length is 79 characters."
        },
        {
            "flag": "-N",
            "long": "--dry-run",
            "arg": null,
            "description": "Do not modify any file, instead only print the files that would be modified."
        },
        {
            "flag": "",
            "long": "--experimental-rts-parser",
            "arg": null,
            "description": "Temporary option accepted for compatibility with an experiment. It no longer does any‐ thing. Please remove any use of it."
        }
    ],
    "examples": [],
    "see_also": []
}