PaddiM8 / kalker

Scientific calculator with math syntax that supports user-defined variables and functions, complex numbers, and estimation of derivatives and integrals
https://kalker.xyz
MIT License
1.59k stars 70 forks source link

Add `help` function #10

Closed oblique closed 3 years ago

oblique commented 4 years ago

It would be nice to have help() function that will print some kind of documentation and also show a list of supported functions.

PaddiM8 commented 4 years ago

Yess, I totally forgot about this.

PaddiM8 commented 4 years ago

Done!

oblique commented 4 years ago

I meant a help command within the interactive interface. For example I want to be able to see a list of the supported commands (https://github.com/PaddiM8/kalk/blob/master/kalk/src/prelude.rs), the operators that you support, maybe some examples, etc.

PaddiM8 commented 4 years ago

Hm, there are quite a lot of functions though. I wonder how readable it would be to print them all out, since I'd want a description of them as well. I'm thinking it could be more convenient to have a separate cli subcommand for that, so that you could grep on it and such. Eg. kalk functions

oblique commented 4 years ago

Maybe you can use pager, like less.

PaddiM8 commented 4 years ago

It would actually be quite neat to have that integrated with the REPL (if even practically doable with rust)... But I also want kalk to also work as a "normal" command-line program, so it could end up being a bit scattered. I'll have to think a bit more about this.

shilangyu commented 4 years ago

+1 for implementing the help function on the CLI level

PaddiM8 commented 3 years ago

You can now type help into the REPL, and it will show you instructions, including all the functions and constants.