diff options
author | John Ankarstr\xf6m <john@ankarstrom.se> | 2021-05-31 19:40:00 +0200 |
---|---|---|
committer | John Ankarstr\xf6m <john@ankarstrom.se> | 2021-05-31 19:40:00 +0200 |
commit | 55032742d5b9817d8fdbe1e9822b74f12c3d08d6 (patch) | |
tree | 6e76aef69582fae56cc77b9e62a2afe1989d1266 /isort | |
parent | a8c2415961ae8b952a4fc57f19435c1d5ef883dd (diff) | |
download | xutil-55032742d5b9817d8fdbe1e9822b74f12c3d08d6.tar.gz |
Add 'isort' utility
Diffstat (limited to 'isort')
-rwxr-xr-x | isort | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -0,0 +1,8 @@ +#!/usr/bin/perl -p + +# isort -- sort C variable declarations separated by commas + +s/([^,]*?)(\S+[,;])/$2/; $prefix = $1; +s/;$/,/; @words = sort split /\s+/; +$_ = $prefix . (join ' ', @words) . "\n"; +s/,$/;/; |