Ticket 10410

Summary: sacct headers not justified
Product: Slurm Reporter: Michael DiDomenico <mdidomenico>
Component: User CommandsAssignee: Scott Hilton <scott>
Status: RESOLVED FIXED QA Contact:
Severity: 4 - Minor Issue    
Priority: --- CC: scott
Version: 20.02.5   
Hardware: Linux   
OS: Linux   
Site: IDACCR Alineos Sites: ---
Atos/Eviden Sites: --- Confidential Site: ---
Coreweave sites: --- Cray Sites: ---
DS9 clusters: --- HPCnow Sites: ---
HPE Sites: --- IBM Sites: ---
NOAA SIte: --- OCF Sites: ---
Recursion Pharma Sites: --- SFW Sites: ---
SNIC sites: --- Linux Distro: ---
Machine Name: CLE Version:
Version Fixed: 21.08.0pre1 Target Release: ---
DevPrio: --- Emory-Cloud Sites: ---

Description Michael DiDomenico 2020-12-09 11:28:42 MST
when using --format with sacct and you justify the columns to the left, the header fields do not justify the same way.

sacct -a --format=jobid%-6,cluster%-10,user%-10,jobname%-20

just as a personable preference, i like the headers to be left or center justified and any column that contains text should be left and anything that's strictly a number to be right

but i understand that might overly complexify the code.  at least having the headers follow the column selection would make it less noticeable.

as an additional enhancement, it would be nice if the --starttime accepted something like -7d instead of making me figure out what the date was a week ago :)
Comment 5 Scott Hilton 2020-12-09 16:38:19 MST
Michael,

I agree, having the header match the column looks better. We went ahead and made the change, but as it isn't technically a bug fix it won't be published until 21.08 is released. See commit b79069d3cdafaa0764c084b4c1cf89f0dc8e14ad on github

However, we will do not plan to center justification or have it automatically change based on data type.

For your final request, you are in luck. I added this feature just a month ago and it was released in 20.11
The syntax is:
now[{+|-}count[seconds(default)|minutes|hours|days|weeks]]
Example:
sacct --starttime=now-7days

-Scott