Indent

Restez toujours informé : suivez-nous sur Google (☆)

Introduction

indent
Importez le logo de ce logiciel
DéveloppeurProjet GNU
Dernière version2.2.9 (19 décembre 2002)
EnvironnementUNIX, BSD, GNU/Linux
LangueAnglais uniquement
TypeIndentation
LicenceGNU GPL
Site Webwww.gnu.org/software/indent

indent est un programme libre de mise en forme de codes sources. Il modifie l'apparence d'un fichier source en ajoutant ou supprimant des espaces et des retours à la ligne.

indent fait partie du projet GNU, Il est distribué selon les termes de la licence GNU GPL.

Exemple

On souhaite indenter le fichier suivant :

/* exemple à indenter */ #include <stdio.h> int main(void) { char msg[] = "hello world\n"; char * end = msg + sizeof (msg); char * cur; for(cur = msg; cur != end; ++cur) { putchar(*cur); } return 0; }

Avec les paramètres par défaut, on obtient le style GNU:

#include <stdio.h> int main (void) { char msg[] = "hello world\n"; char *end = msg + sizeof (msg); char *cur; for (cur = msg; cur != end; ++cur) { putchar (*cur); } return 0; }

Avec l'option -kr (pour "Kernighan and Ritchie"), on obtient :

#include <stdio.h> int main(void) { char msg[] = "hello world\n"; char *end = msg + sizeof(msg); char *cur; for (cur = msg; cur != end; ++cur) { putchar(*cur); } return 0; }