mirror of
https://github.com/MezzalunaWM/Whetstone.git
synced 2026-03-08 04:57:32 -04:00
add help information
This commit is contained in:
parent
86177a190e
commit
721e6bfcb3
1 changed files with 19 additions and 0 deletions
19
src/main.zig
19
src/main.zig
|
|
@ -8,6 +8,18 @@ const gpa = std.heap.c_allocator;
|
|||
|
||||
var remote: Remote = undefined;
|
||||
|
||||
const usage =
|
||||
\\Usage: whet [options]
|
||||
\\
|
||||
\\ Sharpen your Mezzaluna via quick iterations.
|
||||
\\
|
||||
\\Options:
|
||||
\\ -c, --code One shot sending code to Mezzaluna
|
||||
\\ -f, --follow-log Follow the log as it grows
|
||||
\\ -h, --help Print this help and exit
|
||||
\\
|
||||
;
|
||||
|
||||
fn loop(input: bool) !void {
|
||||
var pollfds: [2]std.posix.pollfd = undefined;
|
||||
|
||||
|
|
@ -70,15 +82,22 @@ pub fn main() !void {
|
|||
// long options
|
||||
code: ?[]const u8 = null,
|
||||
@"follow-log": bool = false,
|
||||
help: bool = false,
|
||||
|
||||
// short-hand options
|
||||
pub const shorthands = .{
|
||||
.c = "code",
|
||||
.f = "follow-log",
|
||||
.h = "help",
|
||||
};
|
||||
}, gpa, .print) catch return;
|
||||
defer options.deinit();
|
||||
|
||||
if (options.options.help) {
|
||||
try std.fs.File.stdout().writeAll(usage);
|
||||
std.process.exit(1);
|
||||
}
|
||||
|
||||
// connect to the compositor
|
||||
remote = Remote.init();
|
||||
defer remote.deinit();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue