| 1 |
operz |
1 |
#!/bin/env perl -pln |
| 2 |
|
|
# |
| 3 |
|
|
# $Id: specreform 830 2006-09-19 18:23:08Z comand $ |
| 4 |
|
|
# |
| 5 |
|
|
# Copyright 2006 Cory Omand <comand@blastwave.org> |
| 6 |
|
|
# All rights reserved. Use is subject to license terms. |
| 7 |
|
|
# |
| 8 |
|
|
# Redistribution and/or use, with or without modification, is |
| 9 |
|
|
# permitted. This software is without warranty of any kind. The |
| 10 |
|
|
# author(s) shall not be liable in the event that use of the |
| 11 |
|
|
# software causes damage. |
| 12 |
|
|
# |
| 13 |
|
|
# specreform - Reformat gspec files to a common format. |
| 14 |
|
|
# |
| 15 |
|
|
# Usage: specreform < orig.gspec > new.gspec |
| 16 |
|
|
# |
| 17 |
|
|
|
| 18 |
|
|
# All items line up on 3x tabstop (ts=4) |
| 19 |
|
|
$fmt_col = "16"; |
| 20 |
|
|
|
| 21 |
|
|
if (/^%/) { |
| 22 |
|
|
@a = split; $d = shift @a; |
| 23 |
|
|
$p = $fmt_col - length($d); |
| 24 |
|
|
$_ = $d . " "x$p . join(" ", @a); |
| 25 |
|
|
} |