~arivigo/cras-devel

Thinking of an output format overhaul

Details
Message ID
<20210404122323.xq3estjp5obu3nhv@arch>
DKIM signature
pass
Download raw message
Hi there!
First, Happy Easter! It's sunny here in Pamplona and I'm indoors doing
some *important coding* lol

OK, jokes aside, I've been thinking about how cras outputs things on
screen and I must say, it's very very improvable.

One of the things that has annoyed me the most in these last months is
how (and where) we show the expiry date for a given task file. 

	$ cras some-task-file
	Due date: Sun Apr  4 23:56:38 2021
	
	#01 [TODO] Some task
	#02 [DONE] Very important thing!
	#03 [TODO] Oh, don't forget this one too
	#04 [TODO] Plan world domination
	
	3/1 to do/done

This has way too much vertical spacing now that I've given it some
thought, and the whole thing is... ok, it's grep'able but could do 
way better. cras supports a list-only mode using -l (ell) but that mode
feels more like a patch to overcome the pitfalls of the default one.

I don't know which route I'd go for, but I've been thinking of 
something along these lines:

	$ cras -l some-task-file
	#01 [TODO] Some task
	#02 [DONE] Very important thing!
	#03 [TODO] Oh, don't forget this one too
	#04 [TODO] Plan world domination
		to do/done:3/1
		expires:Sun Apr  4 23:56:38 2021
	$ cras some-task-file
	#01 [TODO] Some task
	#02 [DONE] Very important thing!
	#03 [TODO] Oh, don't forget this one too
	#04 [TODO] Plan world domination

This would turn -l into a 'long' output mode and the new default mode
would just print the task list (as current -l) does. The current -o and
-O modes would probably be merged into one single 'short' mode (-s? 
maybe repurpose -o?). The idea being that if you want to just grab the
counter, you should be able to use a simple shell command to do so.
Hypothetically:

	$ cras -s some-task-file
	to do/done:3/1
	$ cras -s some-task-file | cut -d':' -f 2
	3/1

The 'expires:' field I also feel needs some revamping. Maybe just a
countdown of how many HH:MM are left for the file to expire? I feel we
don't need the amount of precision we're getting right now. 

I'd love to hear what you think about this. I'm commited to get rid of
the current interface (it's awful); just not sure which the right 
direction would look like for an improved cras 2.x.

Cheers!
Ari

-- 
Ariadna Vigo
(she/her)
Web: <https://ariadnavigo.xyz>
PGP: 0xA3B1324836A669BD
Reply to thread Export thread (mbox)