Skip to content

Instantly share code, notes, and snippets.

@hktechn0
Last active August 29, 2015 14:24
Show Gist options
  • Save hktechn0/c8897c71da12d07df2c8 to your computer and use it in GitHub Desktop.
Save hktechn0/c8897c71da12d07df2c8 to your computer and use it in GitHub Desktop.
システムプログラム (syspro) のインデンテーションスタイル
# http://www.coins.tsukuba.ac.jp/~syspro/2015/shui/1stHalf.html#sec:indentation
# 以下のコマンドで、大体上記のスタイルに適合するように、自動でスタイルを修正してくれる
# 綺麗で美しいコードを書こう。
$ indent -nbad -bap -nbc -br -brs -c33 -cd33 -ncdb -ce -ci4 -cli0 -d0 -di1 -nfc1 -i8 -ip0 -l80 -lp -npcs -npsl -sob -nut test.c
$ cat test.c
#include <stdio.h>
int main(int argc, char ** argv){
int a[100] [100];
int i,j;
for(i=0; i < 100;i++){
for(j=0;j<100;j++) {a[i][j]=j;}
}
return 0;
}
$ indent -nbad -bap -nbc -br -brs -c33 -cd33 -ncdb -ce -ci4 -cli0 -d0 -di1 -nfc1 -i8 -ip0 -l80 -lp -npcs -npsl -sob -nut test.c
$ cat test.c
#include <stdio.h>
int main(int argc, char **argv)
{
int a[100][100];
int i, j;
for (i = 0; i < 100; i++) {
for (j = 0; j < 100; j++) {
a[i][j] = j;
}
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment