10 Commits

Author SHA1 Message Date
d1803284b4
noclip: repub imports
As far as I can tell, there's no good reason not to do this.
2023-07-31 12:40:37 -07:00
3acc412f2e
restructure
the checklist of things to do is continuing to dwindle. hooray. last
big feature push is help text generation. Then improving error
reporting. Then writing some tests. Then writing documentation.

Ay carumba.
2023-04-06 18:31:29 -07:00
c870347f74
noclip: improve help generation formatting
There are still quirks here. It's worth deciding if help descriptions
should be automatically hard-wrapped. Multi-line descriptions require
appropriate indentation after the first line. Long descriptions will
automatically be wrapped by the terminal.

The refactoring itch continues to grow.
2023-03-23 01:02:54 -07:00
af71064d7f
noclip: support --long=value style long options as well
I think this is a very reasonable way to do this. Not much complexity.
2023-03-23 00:47:34 -07:00
261ae7af31
noclip: fix program basename getting for subcommands
This doesn't unnecessarily consume arguments from the CLI argument
iterator any more.
2023-03-23 00:43:23 -07:00
5eee6ecde0
sorta help text generation
This mostly works. Subcommands are utterly broken because we blindly
consume an additional argument to get the program name, which we
should not do.

This code was always kind of spaghetti, but it's getting worse. I want
to refactor it into something that doesn't make me cringe, but at the
same time, this project was intended to be a means to an end rather
than the end itself, and it kind of feels a bit silly to spend a ton
of time on it. On the other hand, relying on it for other projects
seems silly if it's a fragile mess. The goal was to get it into a
usable state and then hack on it as necessary, but it still has a ways
to go to get there, and working on it is kind of painful, in an
existential fashion.

Perhaps I will attempt to rewrite it, get halfway, and stall forever.
Thanks for reading my cool commit message blog. Bye.
2023-03-20 23:14:05 -07:00
9480d23f2d
all: update to zig 0.11.0-pre syntax
For loop syntax changed. Also `orelse` apparently no longer works with
non-optional types, which is reasonable but annoying. The path of
least resistance is to make the flag default type optional to mirror
options/arguments.
2023-03-20 23:02:29 -07:00
04722f938e
all: continue organization and add bakery
The bakery bakes the user context type into an object so that it
doesn't have to be specified over and over again. This ends up being a
nicer way of specifying the CLI parameters, except for the fact that
it requires a slightly odd comptime block construct due to `var` not
working at the top level for some reason (and `comptime var` also not
working).
2022-11-27 10:59:06 -08:00
b1bac01257
all: start organizing into components and add user context support
The user can provide a context type and corresponding value that will
get passed into any executed callbacks. This allows for complex
behavior through side effects and provides a mechanism by which the
user can pass an allocator into argument handlers, etc.

There was also a lot of restructuring in this including a bit more
automagical behavior, like making parameters that wrap optional types
default to being optional. The start of automatic handler picking
(user overridable, of course) is in place as well.

Needing to specify the userdata context type makes things a bit more
verbose, and there's some other jank I'm interested in trying to
remove. I have some ideas, but I don't know how far I can go in my
abuse of the compiler.

However, this seems like it will be usable once I get around to writing
the help text generation.
2022-11-27 01:31:24 -08:00
e4b11a16ce
init 2022-11-20 12:54:42 -08:00