tiny.smg.command.watch
Defined in command.
API (1)
Actions
Public operations.
Source
Source: tools/smg/src/command/root.zig:25
zig
pub const watch = @import("watch.zig");Source: tools/smg/src/command/watch.zig
zig
const std = @import("std");const smg = @import("../root.zig");const watch = smg.watch;const cli_options = smg.cli.options;const cli_validation = smg.cli.validation;const storage = smg.storage;pub fn run(allocator: std.mem.Allocator, phases: std.mem.Allocator, args: []const []const u8, limits: smg.Limits) !u8 { const signature = "[OPTIONS] [PATHS]..."; if (try cli_validation.rejectMissingOptionValues(allocator, args, &.{"--debounce"})) return 2; if (try cli_validation.rejectUnexpectedOptionsPlain(allocator, "watch", signature, args, &.{"--debounce"})) return 2; if (try cli_validation.rejectInvalidFloatOption(allocator, "watch", signature, args, "--debounce")) return 2; const paths = try cli_options.positional(allocator, args); if (try cli_validation.rejectMissingPaths(allocator, "watch", signature, paths)) return 2; const root = try storage.requireRoot(allocator); const debounce = if (cli_options.flagValue(args, "--debounce")) |raw| std.fmt.parseFloat(f64, raw) catch unreachable else 0.5; try watch.run( allocator, phases, root, paths, debounce, limits, storage.graph.publish, ); return 0;}Audit
| Definitions | 2 |
|---|---|
| Public names | 2 |
| Members | 0 |
| Version | 26.7.0 |
| Revision | daab053ee433 |