Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] indenting C labels



On 6/22/07, Mattia Dongili <malattia@example.com> wrote:
On Fri, Jun 22, 2007 at 05:23:19PM +0900, Josh Glover wrote:
> On 22/06/07, Nguyen Vu Hung <vuhung16plus@example.com> wrote:
>
> >when I run "indent -br -i8 file.c", the labels in the C are moved 0x07
> >spaces to the right of pages.
> >
> >But I want to indent labels to leftmost of pages.
>
> indent -br -i8 file.c \
>  && sed -i -e 's/^[[:space:]]\+\([^:]\+:\)$/\1/' tmp/file.c

won't this also grab switch/case labels?


Yes, but we can fix that:

indent -br -i8 file.c | \
sed -i -e 's/^[[:space:]]\+\([^:]\+:\)$/\1/' | \
indent -cbi1 -cli1

--
Best Regards,
Nguyen Hung Vu
vuhung16plus{remove}@example.com
An inquisitive look at Harajuku
http://www.flickr.com/photos/vuhung/sets/72157600109218238/


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links