Skip to content

Commit

Permalink
Updated UserGuide for new license command and command line switch
Browse files Browse the repository at this point in the history
Also modified the width for many of the table columns to better
show the commands with less wrapping.
  • Loading branch information
frossm committed Dec 27, 2022
1 parent 587708d commit eabc225
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion mdbook/src/Chapters/CalculatorCommands.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ In Calculator Commands, these are the basic commands that operations on the numb

These commands, like the others you'll read about later, are executed by typing the command name, and any needed arguments into RPNCalc. Often there are several different names and abreviations for the same command. This is just to make it easier to remember. Brackets, `[]` around an option denotes it is optional.

|Command|Description|
|<div style="width:90px">Command</div>|Description|
|-------|-----------|
|%| **PERCENT**<br>Assumes `line1` contains a percent. This converts that into a number by simply dividing that value by 100. For example, if you want to take 50.123% of a number, you could just enter in `50.123 [ENTER] % [ENTER] *`|
|aa [keep]| **ADD ALL**<br>Add all stack items together and replace the numbers on the stack with the result. If the optional `keep` parameter is sent, the elements added will be retained on the stack and the total will be added to the top of the stack. The entire `keep` command is not necessary, anything that starts with `k` will work|
Expand Down
13 changes: 7 additions & 6 deletions mdbook/src/Chapters/CommandLineOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ Currently there are several command line options, and all are optional. Normall

These options will either start RPNCalc in a certain "mode" such as `Debug` or `No Color` or will provide information and exist such as `Version` or `Help`.

|Option|Name|Description|
|<div style="width:90px">Option</div>|Name|Description|
|------|----|-----------|
|-D | `DEBUG MODE`| Runs the program in debug mode. This will display quite a bit of information in RED as you use the program. This is mostly used by the developer and clutters everything up, but you may find it useful if you are trying to debug something. I could certainly add a lot more if needed, but it's useful today. You can also toggle debug mode on/off by entering in the command `debug` while within the program - you don't have to restart RPNCalc|
|-l `name` |`LOAD STACK`| Load a saved stack. This essentially will "name" your session and store the stack upon exit in the Java preferences system. You can load the stack with the `-l name` command line option, or from within the program by using the `load name` command. Please note the name field is whatever you want to call the instance but avoid spaces in the name. I'm not aware of a limit to the number of saved stacks You can have. If the name to load does not exist, the stack will be created and saved when you exit.|
|-z| `DISABLE COLOR`| Disable colorized output. Useful if your current terminal doesn't support ANSI color sequences|
|-v| `VERSION`| This will display the current program version, but will also check GitHub for the leatest release. It is possible, especially if you are using RPNCalc as a Snap, to have a later version than the latest GitHub release.|
|-h or -?| `HELP`| Display the program help page and exit. This is the same as the `h` or `help` command within RPNCalc|
|-D <br> --debug| `DEBUG MODE`| Runs the program in debug mode. This will display quite a bit of information in RED as you use the program. This is mostly used by the developer and clutters everything up, but you may find it useful if you are trying to debug something. I could certainly add a lot more if needed, but it's useful today. You can also toggle debug mode on/off by entering in the command `debug` while within the program - you don't have to restart RPNCalc|
|-l `name` <br> --load `name`|`LOAD STACK`| Load a saved stack. This essentially will "name" your session and store the stack upon exit in the Java preferences system. You can load the stack with the `-l name` command line option, or from within the program by using the `load name` command. Please note the name field is whatever you want to call the instance but avoid spaces in the name. I'm not aware of a limit to the number of saved stacks You can have. If the name to load does not exist, the stack will be created and saved when you exit.|
|-z <br> --no-color| `DISABLE COLOR`| Disable colorized output. Useful if your current terminal doesn't support ANSI color sequences|
|-L <br> --license| `DISPLAY LICENSE`| Display the RPNCalc usage license. Currently, RPNCalc uses the [The MIT License](https://opensource.org/licenses/MIT)|
|-v <br> --version| `VERSION`| This will display the current program version, but will also check GitHub for the leatest release. It is possible, especially if you are using RPNCalc as a Snap, to have a later version than the latest GitHub release.|
|-h <br> -? <br> --help| `HELP`| Display the program help page and exit. This is the same as the `h` or `help` command within RPNCalc|
2 changes: 1 addition & 1 deletion mdbook/src/Chapters/Conversions.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The `frac [base]` command takes the item on the top of the stack (`line1`) and d
if `frac 2` woulc have been entered (which means 1/2 is maximum granularity), you get `1.1234 is approximately 1 0/1` or just one. *Need to look into that display oddity*.|


|Command|Description|
|<div style="width:90px">Command</div>|Description|
|-------|-----------|
|frac [base]|Display a fractional estimate of the last stack item (`line1`) with the maximum granularity of 1/[base]. See the above description for more detail|
|in2mm<br>2mm|Converts the value in `line1` from inches to millimeters|
Expand Down
2 changes: 1 addition & 1 deletion mdbook/src/Chapters/MemoryCommands.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The operational command `reset` will reset all of the persistant settings back t

The normal usage to is to save a value from the current `line1` into a memory slot and copy it back later. The memory slots are saved between program executions so if you need it in a later session, it will be there. It's saved in the Java preferences system as discussed earlier.

|Command|Description|
|<div style="width:135px">Command</div>|Description|
|-------|-----------|
|mem [slot] add|`mem X add`<br>Will add the top stack item (`line1`) into the memory slot X. By default, there are 10 slots; 0 through 9. If you do not provide a slot number it will default to `slot0`<br>Example: `mem add` will add the contents of `line1` into memory `slot0`|
|mem [slot] copy<br>mem [slot] recall|`mem X copy`<br>Copies the contents of memory slot provided back onto the stack. Defaults to `slot0` if no slot number is provided|
Expand Down
7 changes: 4 additions & 3 deletions mdbook/src/Chapters/OperationalCommands.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

Operational commands are commands that do not directly impact your stack numbers. These tend to be display commands or those the interact with the the setting of RPNCalc directly.

|Command|Description |
|<div style="width:100px">Command</div>|Description |
|-------|-------------|
|debug|Toggle debug mode which will display additional information on what's happening internally in the program. Same as the `-D` command line switch. Probably not the useful for a normal user|
|h <br> ?|`h` or `?` will display the in-program help page|
|import `FILENAME`|With `import` RPNCalc will replace the current stack with one loaded from a file. The file format is simple, just one number per line. Do not include any comments or alphanumeric/special characters. Just one number per line with the last number being `line1` - just like the display in RPNCalc|
|import `FILE`|With `import` RPNCalc will replace the current stack with one loaded from a file. The file format is simple, just one number per line. Do not include any comments or alphanumeric/special characters. Just one number per line with the last number being `line1` - just like the display in RPNCalc|
|list stacks|List the current saved stacks on the system, including the one currently in use|
|list mem|Display the contents of the memory slots|
|list undo|Displays all of the saved stacks and their contents used for undo operations. Basically what your stack will look like when you perform an undo. These are not saved between RPNCalc executions|
Expand All @@ -19,8 +19,9 @@ Operational commands are commands that do not directly impact your stack numbers
|set|Display the current values of the configurable persistent settings|
|set width `NUM`| Sets the width of the program. The default is 80 characters. If you are using a small display, and the calculator wraps, this can be used to make the width smaller (or larger). Please note that there is a minimum width that must be used. At the time of this writing, it's 46 characters. This setting is persistent across RPNCalc executions|
|set memslots `NUM`| Set the number of memory slots available to RPNCalc to `NUM`. The default is 10 slots, numbed 0 through 9. If you need more, or less, it can be changed with this command. The setting is persistent across RPNCalc executions. `set mem` or `set memoryslots` may also be used. See the memory commands chapter for more information|
|set align `l\|d\|r`| Set the alignment of the stack when it's displayed. The default is `l` or left alignment. The numbers are aligned to the left. `r` or right alignment has the numbers aligned to the right. `d` or decimal aligns all of the decimal points together in a column. This setting is persistent across RPNCalc executions. `set alignment` may also be used|
|set align `l`<br>set align `d`<br>set align `r`| Set the alignment of the stack when it's displayed. The default is `l` or left alignment. The numbers are aligned to the left. `r` or right alignment has the numbers aligned to the right. `d` or decimal aligns all of the decimal points together in a column. This setting is persistent across RPNCalc executions. `set alignment` may also be used|
|ss|Swap the current stack with the secondary. The primary and secondary stacks are described in the Stacks section. Executing `ss` again will swap them back. The secondary stack it just a place to do a bit of other work then you can swap back. They are in no way connected. The secondary stack is also saved upon exit|
|license| Display the license text for RPNCalc. Currently, RPNCalc uses the [The MIT License](https://opensource.org/licenses/MIT)
|ver| Display the current version number and copyright as well as the latest GitHub release. This is equivalent to the `-v` command line option. Users of Snap installations will automatically be up to date.|
|cx<br>clearexit|`cx` or `clearexit` will clear the stack and then exit the program|
|x<br>exit<br>quit<br>ctrl-c|Exit the program. The primary stack, secondary stack, and memory slots will be saved upon exit|
3 changes: 2 additions & 1 deletion mdbook/src/Chapters/TrigFunctions.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ RPNCalc does not consider itself a scientific calculator (at least not currently

Lastly, I'm happy to add more capabilities if there is a desire (and an offer to help test).

|Command|Description|
|<div style="width:90px">Command</div>|Description|
|<div style="width:90px">Command</div>|Description|
|-------|-----------|
|sin [rad]<br>cos [rad]<br>tan [rad]|Calculate the [trigonometry](https://en.wikipedia.org/wiki/Trigonometry) function requested. Angles are input as degrees by default unless the optional `rad` parameter is given in which case the angles will be in [radians](https://en.wikipedia.org/wiki/Radian).<br><br>**Example:** `tan` will calculate the tangent using `line1` as the angle in degrees. Use `tan rad` if `line1` contains the angle in radians|
|asin [rad]<br>acos [rad]<br>atan [rad]|Calculate the arc [trigonometry](https://en.wikipedia.org/wiki/Trigonometry) function. Like the above, the result is returned in degrees unless `rad` parameter is provided|
Expand Down
2 changes: 1 addition & 1 deletion mdbook/src/Chapters/UserDefinedFunctions.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The following commands can be entered during a recording, but are not recorded.
- set, reset
- cx, x, quit, exit

|Command|Description|
|<div style="width:110px">Command</div>|Description|
|-------|-----------|
|record on<br>rec on|Turn on recording. Most commands and numbers entered after record is enabled will be saved. There are some that are excluded from being recorded as detailed above|
|record off<br>rec off| Turn off recording. The user will be prompted to enter in a name for this function and that name will be used to run it in the future. If you do not enter in a name the recording is canceled and nothing will be saved|
Expand Down

0 comments on commit eabc225

Please sign in to comment.