Comments (1)
@Almenon, thanks for the bug report, and sorry for my delay getting back to you.
I can reproduce this behavior, but I consider this to be a feature and not a bug, and I don't plan to change the current behavior. I'll explain my reasoning.
As you've discovered, this error occurs when cheat
attempts to load a cheatsheet that contains malformed front-matter. There are essentially only four behaviors that we could implement here:
- Fail with an explicit error message. (This is the current behavior.)
- Entirely ignore the cheatsheet with the malformed front-matter
- Discard the malformed front-matter, but otherwise attempt to use the cheatsheet.
- Discord the malformed front-matter, write a warning to
stderr
, and attempt to use the cheatsheet.
Of the four, I think option one - the current behavior - is preferable.
If we pursue option two, we'll inevitably "hide" cheatsheets from users as they become malformed through editing. Worse, we'll also hide the fact that we're hiding them! The user will simply be unaware that their cheatsheets contain errors, and that they're being silently ignored.
If we pursue option three, cheatsheet content will still be searchable (via -s
), but tagging will be silently broken. And, once again, the user will be unaware that there's a problem.
Option four perhaps improves upon option three, but there's still a risk that the user simply does not see the error written to stderr
. This risk increases with the length of a cheatsheet, and some cheatsheets can be quite long.
With all of that said, I think the "hard" failure is probably best for the user in the long-term, if inconvenient in the short-term (in that a user will be required to fix their cheatsheets immediately, prior to resuming their use of cheat
).
I'm going to close this ticket, but I'm open to feedback if you have a differing opinion, and/or other suggestions for behaviors that I have not considered above.
Thanks.
from cheat.
Related Issues (20)
- Listing cheats forces pager on latest Debian/Ubuntu HOT 6
- New cmd implementation in minimal POSIX sh? HOT 1
- Colorized output and search shows ANSI Escape Sequences HOT 13
- Version 4.2.7 broke personal cheatsheets in custom location HOT 11
- Git submodules as cheatsheet paths don't work any more HOT 6
- `cheat -l` gives error if cheatpath dir contains `.gitignore` (but no `.git/`) HOT 7
- Autocompletion Not working HOT 3
- frontmatter error HOT 20
- Cheat fails to show when the filepath contains directories that end in ".git"
- Cheat files tagged personal going into unexpected folder HOT 3
- safer installer? HOT 1
- feat: add cheatsheet for Vite. HOT 1
- Failed to parse front-matter HOT 4
- failed to write to pager: exec: "PAGER_PATH": executable file not found in $PATH HOT 7
- yaml unmarshal error :: Cannot unmarshal !!str `tags [ ...` into sheet.frontmatter HOT 2
- lstat /home/foo/.config/cheat/cheatsheets: no such file or directory HOT 1
- Magic SysRq REISUB HOT 1
- Update chroma dependency HOT 1
- Config option to exclude files
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cheat.