Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2001:
[Freeciv-Dev] Re: Indentation in switch()
Home

[Freeciv-Dev] Re: Indentation in switch()

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>
Cc: rf13@xxxxxxxxxxxxxxxxxxxxxx, Freeciv development list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: Indentation in switch()
From: Petr Baudis <pasky@xxxxxxxxxxx>
Date: Wed, 5 Dec 2001 20:18:07 +0100

Dear diary, on Wed, Dec 05, 2001 at 07:06:29PM CET, I got a letter,
where Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx> told me, that...
>  --- Petr Baudis <pasky@xxxxxxxxxxx> wrote: 
> 
> > > > with indent -kr -i2 -cli1 
> > -cli2 has desired result it looks.
> 
> On my indent it gives:
> 
> switch (i) {
>   case 0:
>   break;
>   case 1:
>   {
>     ++i;
>   }
>   default:
>   break;
> } 
Sorry, however I just didn't manage to get something like this from indent :).

host@machine:~$ cat switch.c
switch (i) {
case 0:
break;
case 1:
{
  ++i;
}
default:
break;
}
host@machine:~$ indent -kr -i2 -cli2 <switch.c
switch (i) {
  case 0:
    break;
  case 1:
    {
      ++i;
    }
  default:
    break;
}
host@machine:~$ indent --version
GNU indent 2.2.6

-- 

                                Petr "Pasky" Baudis

UN*X programmer, UN*X administrator, hobbies = IPv6, IRC, FreeCiv hacking
.
  "A common mistake that people make, when trying to design
   something completely foolproof is to underestimate the
   ingenuity of complete fools."
     -- Douglas Adams in Mostly Harmless
.
Public PGP key, geekcode and stuff: http://pasky.ji.cz/~pasky/


[Prev in Thread] Current Thread [Next in Thread]