Default behavior when cheat a subdirectory
# structure in cheat directory
golang/index
golang/loop
cheat golang/index # open golang/index
cheat golang/loop # open golang/loop
cheat golang # open golang/index by default
It's useful to arrange programming language's cheatsheet
That's an interesting idea. I see how this could be useful.
Let me experiment a bit with this. I'll update the ticket when I have more information.
Thanks.
Thx. I have another idea about this:
# structure in cheat directory
golang/golang
golang/loop
cheat golang/golang # open golang/golang
cheat golang/loop # open golang/loop
cheat golang # open golang/golang by default
I have implemented it in https://github.com/cheat/cheat/pull/586
Both ideas are good. But, I think, first variant is easier to implement. @chrisallenlane, are you need to help with realization? I don't write on Go, but I think it not a very hard in this case. Or we can request help in community.
An update to this enhancement: Recursive going deep. I mean:
cheat golang # open golang/index
cheat golang/loop # open golang/loop if this a file
# if golang/loop is directory open golang/loop/index
In this case we can create a tree of cheatsheets. Example:
cheat tar/create/compressed
cheat tar/create/bz2
@chrisallenlane, are you need to help with realization? I don't write on Go, but I think it not a very hard in this case. Or we can request help in community.
I don't think there's a huge amount of work here. It needs to be considered alongside #548, though, so I'll probably implement both of those features simultaneously.
I should be able to handle this solo, but I appreciate the offer to marshal some help. I'm just a bit time-crunched at present. I should be able to get to this sometime around mid-October. I'll update this thread as I make progress.
This sounds like an interesting idea. @chrisallenlane if you're still time-crunched can I step in to work on this issue?
@srafi1, thanks for the offer, but I should be able to get to this this week. It's probably best that I take this on myself - we have like 3 open tickets that are all going to impact each other. :slightly_smiling_face:
Hi there, sorry for the bump but any plans for this feature? Right now it feels a bit weird to have to choose between having subdirectories or a single big sheet.
To complete OP's examples, if you have a bunch of Bash cheats, you may want to put them in in bash directory so that you can split between cheat bash/getopts, cheat bash/arrays, cheat bash/dicts, whatever, but it becomes awkward to put general bash cheats such as special arguments $*, $@, or last command tokens !!, !$ in dedicated named sheet like cheat bash/arguments and cheat bash/tokens, where it would feel more natural to get them with cheat bash.
Unfortunately I don't know Go and wouldn't know how to write the MR 😭
By the way thank you for this neat little tool, been using it daily since 2019 now, aliased it to c.