ksting [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=44724 Utility: infman - Command list and manual <p> <table><tr><td> <a href="/bbs/?pid=143607#p"> <img src="/bbs/thumbs/pico64_infman-1.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=143607#p"> Infman 1.2.4</a><br><br> by <a href="/bbs/?uid=44724"> ksting</a> <br><br><br> <a href="/bbs/?pid=143607#p"> [Click to Play]</a> </td></tr></table> </p> <p><strong>IMPORTANT: Picotron 0.1.0c adds a new command called <code>info</code>. As such, this cartridge has been renamed to <code>infman</code>. Please update this command if you have an older version installed, then use <code>rm /appdata/system/util/info.p64</code> to delete the old version!</strong></p> <p>This cartridge is a really simple utility that acts as a command list and manual. The goal of this utility is to make it so you don't have to worry if a command has a <code>--help</code> parameter or not (which I've noticed is wildly inconsistent, even among the builtin commands), and also to give an easily accessible list of commands (since <code>help</code> doesn't list them all)</p> <h2>Installation</h2> <p>First, load the cart with <code>load #infman-1</code><br /> After loading, you have two options for &quot;installation&quot; (these work for updating too):</p> <ul> <li>Manual install: You can run <code>save /appdata/system/util/infman.p64</code> to save it to your system tools (make sure the <code>util</code> folder exists first!) You can call it whatever you like, but it references itself as 'infman' in it's own manual</li> <li>Automatic Install: You can simply press CTRL-R and the cart will try to install itself. Note that this will overwrite any file you might have named <code>/appdata/system/util/infman.p64</code></li> </ul> <h2>Features</h2> <ul> <li>List all available commands</li> <li>Built-in manual for the system commands</li> <li>Support for custom manuals for user commands</li> </ul> <h2>Usage</h2> <p>You can run the utility with <code>infman [options][command name][page]</code></p> <p>Possible options are:</p> <ul> <li><code>--system</code> or <code>-s</code> to list only system commands</li> <li><code>--user</code> or <code>-u</code> to list only user (appdata) commands</li> <li><code>--highlight</code> or <code>-h</code> to highlight commands with no manual in red</li> </ul> <p>If you run it without any arguments, it'll list both system and user commands.</p> <p>If you supply a command name, it'll give a manual for that command. There's already manual pages built in for the default system commands, but manual pages have to be <strong>manual</strong>ly added (get it?) for user commands.</p> <p>If no page is specified, it shows the first page by default. If the page is set to <code>0</code>, it shows the entire manual, ignoring page breaks.</p> <h3>Adding custom manual pages</h3> <p>You have 3 options:</p> <ul> <li>Make a file called <code>[command]_manual.txt</code> in the same folder as the command, where <code>[command]</code> is the name of the command. The utility will read whatever is in this text file.</li> <li>Make a file called <code>manual.txt</code> inside the command's <code>.p64</code> folder, if the command is a <code>.p64</code> to begin with</li> <li>Add a multiline comment to the top of the command's code (in <code>[command].lua</code> or <code>main.lua</code>)</li> </ul> <p>You can add page breaks to your manuals by putting the text <code>---</code> on a line all by itself. You can put as many newlines before or after the page break as you like.</p> <p>Manual pages also support a limited set of p8scii formatting, allowing you to use features such as text colours!</p> <h2>Repository</h2> <p>The source code for this project can be found at <a href="https://github.com/kitsting/picotron-info-viewer">https://github.com/kitsting/picotron-info-viewer</a><br /> Have a bug to report? Want to add a feature I'm too lazy to add? This is the place to do that.</p> <h2>Changelog</h2> <p>1.2.4</p> <ul> <li>Updated the metadata so it shows the correct version and name</li> <li>Updated the infman manual (it was showing the old name before)</li> </ul> <p>1.2.3 - Very quick fix</p> <ul> <li>Renamed the command to <code>infman</code> to avoid a conflict with Picotron 0.1.0c's <code>info</code>. Please update if you haven't already! <ul> <li>Made some changes to allow for renaming to be easier in the future, if needed</li> </ul></li> <li>Added manual pages for <code>pwd</code>, <code>pwc</code>, <code>info</code> (the new one), <code>shutdown</code>, and <code>reboot</code></li> <li>The cart metadata has the wrong version and name. I can't seem to fix this at the moment</li> </ul> <p>1.2.2</p> <ul> <li>Fixed a spacing issue (maybe?)</li> <li>File extension parsing has been improved <ul> <li>Now files like <code>mycommand.lua.[something]</code> and <code>coolutility.p64.[something]</code> are ignored</li> </ul></li> <li>Lots of other small code changes (i forgot what they are)</li> </ul> <p>1.2.1</p> <ul> <li>Improved page break parsing <ul> <li>Empty pages are now ignored</li> </ul></li> <li>Added automatic installer (should work perfectly fine but use at your own risk)</li> <li>Manual pages for system commands are now stored as individual text files instead of one big array</li> </ul> <p>1.2</p> <ul> <li>Added support for p8scii formatting (doesn't support <em>all</em> p8scii formatting, but enough to be functional) <ul> <li>Supported characters (as of now) are <code>\f</code>, <code>\#</code>, <code>\v</code>, and <code>\^</code></li> </ul></li> <li>Multiline comment parsing has been improved (thanks <a href="https://www.lexaloffle.com/bbs/?uid=27691">pancelor</a>!)</li> </ul> <p>1.1</p> <ul> <li>Added support for pages</li> <li>Added <code>-h</code> flag</li> <li>General code cleanup (its not as hacky now (its still a little hacky))</li> </ul> <h2>Planned features</h2> <p>These features have no planned date. They could release tomorrow or a month from now.</p> <ul> <li>View manuals in the system notebook program</li> <li>Yotta support</li> </ul> https://www.lexaloffle.com/bbs/?tid=140840 https://www.lexaloffle.com/bbs/?tid=140840 Mon, 18 Mar 2024 01:04:08 UTC