That particular function, `nb show`, is a big `if` statement checking the file type and environment for available tools. I'm more than happy for suggestions and / or pull requests for optimizing that.
Note that Bash is a weird language that doesn't provide language features found in normal languages, and this targets old Bash which doesn't even have associative arrays, so there are things that might look "wrong", but aren't necessarily in this context. That's a big part of what makes it interesting to code in.