I have a file with the following content:
/** doxygen comment for enum member1 */
COMMON_PREFIX_name1 = 1,
/** doxygen comment for enum member2 */
COMMON_PREFIX_name2 = 2,
/** doxygen comment for enum member3 */
COMMON_PREFIX_name3 = 3,
/** doxygen comment for enum member4 */
COMMON_PREFIX_name4 = 4,
...
Is is possible to sort the definitions by the name1, name2, etc. suffixes in the member names, and keep each comment above the corresponding definition?
I propose the following sequence of actions.
Join the paired lines:
Sort the joined lines by the variable names’ suffixes:
Split the sorted lines back:
You can run all three commands at once: