Use indent in Linux to format the code style

Source: Internet
Author: User
Reprinted please indicate the source and the author contact: http://blog.csdn.net/mimepp
Contact information: Yu Tao <yut616 at Sohu dot com>

Linux Kernel has a script lindent to help youCodeMake a good code format.
Example:/usr/src/linux-headers-2.6.22-14/scripts/lindent

It uses the indent command to optimize the code.
Indent-NPRO-Kr-i8-TS8-sob-L80-SS-NCS

Parameter description:
-NPRO or -- ignore-profile do not read indent's configuration file. indent. Pro.
-Kr specifies the format of kernighan & Ritchie.
-I8 -- indent-level: set the number of cells to 8.
-TS8: Set the tab Length
-Sob or -- swallow-optional-blank-lines Delete unnecessary blank lines.
-Line feed of L80 Code exceeding 80
-SS or -- space-special-semicolon if the for section contains only one line, add a space before the semicolon.
-NCs or -- no-space-after-casts should not be empty after cast.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.