From 55032742d5b9817d8fdbe1e9822b74f12c3d08d6 Mon Sep 17 00:00:00 2001 From: "John Ankarstr\\xf6m" Date: Mon, 31 May 2021 19:40:00 +0200 Subject: Add 'isort' utility --- isort | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 isort diff --git a/isort b/isort new file mode 100755 index 0000000..27a589d --- /dev/null +++ b/isort @@ -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/,$/;/; -- cgit v1.2.3