aboutsummaryrefslogtreecommitdiffstats
path: root/l/src/option.lisp
AgeCommit message (Collapse)Author
2021-02-27Move everything from `l/` into the project rootTeddy Wing
This is the final project. Now that we got rid of the web extension and native host code, we can move the Lisp code to the root.
2021-02-27main: Move command line option definitions to `option.lisp`Teddy Wing
Makes more sense to group the option code together.
2021-02-27option: Add documentationTeddy Wing
2021-02-21Add `--debug` option to print debug outputTeddy Wing
Let's keep a way to print WebSocket messages for debugging purposes in the release build rather than remove the messages completely. Since I've been struggling with the messages so much it seems like this could be a useful thing to have.
2021-02-13Replace exit codes with constants from the `sysexits` systemTeddy Wing
2021-02-13Add a generic "print error and exit" functionTeddy Wing
I wanted to centralise the formatting of error printing.
2021-02-08Try reloading active tab after reloading all extensionsTeddy Wing
Trying to set up the reload on the active tab after all extensions are reloaded. It's only working half the time and I can't figure out what I'm doing wrong. Something wrong with the wait group I think. Committing what I have and might try other ideas.
2021-02-03parse-options: Error if no extension ID arguments were givenTeddy Wing
2021-02-03config: Initialise a new websocket-driver client on new configTeddy Wing
Add a new `make-config` function to construct a `config` object. This creates a new websocket-driver client and stores it in the `ws-client` slot in the `config`. Before this, I thought about using a writer method on the `socket-url` slot that creates a new client. This didn't work in `make-instance` though. Perhaps there's a way to have the `:initarg` use the writer, but I'm not sure.
2021-02-03parse-options: Exit with error if `--socket-url` isn't givenTeddy Wing
2021-02-03main: Move option parsing code to new function `parse-options`Teddy Wing
Make a new function `parse-options` that parses the command line options and returns a `config` object. We'll use that object instead of `options` in `main`. Cleans up the `main` function a bit. Currently, we just print the `config` object to ensure we're storing the proper values. Followed Practical Common Lisp's example to implement `print-object` so we can see the contents of its slots: http://www.gigamonkeys.com/book/practical-a-spam-filter.html#the-heart-of-a-spam-filter Still need to implement error checking for a missing `--socket-url` option.
2021-02-02main: Handle command line argument parsing errorsTeddy Wing
Add an error handler that just prints the error messages from 'unix-opts' to standard error and exits with EX_USAGE. Inspired by: - http://lispcookbook.github.io/cl-cookbook/scripting.html#handling-malformed-or-missing-arguments - https://github.com/libre-man/unix-opts/blob/0e61f34b2ecf62288437810d4abb31e572048b04/example/example.lisp
2021-02-02main: Start command line option parsingTeddy Wing
Include the 'unix-opts' library described in http://lispcookbook.github.io/cl-cookbook/scripting.html#parsing-command-line-arguments for command line option parsing. Define the options I need. We want a `--socket-url` option, and a list of extension IDs as free arguments. Implement the `-V` version command line argument. Thanks to JJJ (https://stackoverflow.com/users/1337941/jjj) on Stack Overflow for describing how to get the version number of an ASDF system: https://stackoverflow.com/questions/11084339/getting-the-version-of-an-asdf-system/11088022#11088022 Add a new `options.lisp` file where we'll add the option parsing restart error handling functions required by 'unix-opts'.