Refactor list-prs with centralized field names

modify list-prs to move the list of fieldnames into a single variable at the top for easy modification

Done. The field names are now in the FIELDS variable at the top, and the header for tab output is in the HEADER variable. Both are referenced throughout the script instead of being hardcoded.

can you do better and derive the HEADER and the template string from the list of fields?

Perfect! Now the script derives both the header and template string from the FIELDS variable. You only need to modify the FIELDS variable to change what data is included, and the header and template will automatically update to match.

run the script with and without --json to check that it works

Perfect! Both formats work correctly now:

  • JSON format properly renames 'number' to 'id'
  • Tab-separated format shows proper header and data columns