tiny.smg.command.analyze.overview_command
Defined in command.analyze.
API (1)
Actions
Public operations.
Source
Source: tools/smg/src/command/analyze/overview.zig
zig
const std = @import("std");const smg = @import("../../root.zig");const analysis = smg.analysis;const cli_options = smg.cli.options;const cli_output = smg.cli.output;const cli_session = smg.command.session;const cli_validation = smg.cli.validation;pub fn run(allocator: std.mem.Allocator, phases: std.mem.Allocator, args: []const []const u8, limits: smg.Limits, boundary: cli_session.PhaseBoundary) !u8 { if (cli_options.hasFlag(args, "--json")) { try cli_output.writeNoSuchOption(allocator, "overview", "[OPTIONS]", "--json"); return 2; } if (try cli_validation.rejectMissingOptionValues(allocator, args, &.{ "--top", "--format" })) return 2; if (try cli_validation.rejectUnexpectedOptionsPlain(allocator, "overview", "[OPTIONS]", args, &.{ "--top", "--format" })) return 2; const pos = try cli_options.positional(allocator, args); if (pos.len != 0) { try cli_output.writeClickUsageError(allocator, "overview", "[OPTIONS]", try cli_validation.unexpectedArgumentMessage(allocator, pos)); return 2; } if (try cli_validation.rejectInvalidIntegerOption(allocator, "overview", "[OPTIONS]", args, "--top")) return 2; if (try cli_validation.rejectInvalidChoiceOption(allocator, "overview", "[OPTIONS]", args, "--format", &.{ "text", "json" })) return 2; const loaded = try cli_session.loadRead(allocator, phases, limits, boundary); defer boundary.beginTeardown(); const graph = loaded[1]; const top = cli_options.signedOptionValue(args, "--top", 10); const json = std.mem.eql(u8, cli_options.flagValue(args, "--format") orelse "text", "json"); return try cli_output.writeOut(try analysis.overview(allocator, graph, top, json));}Source: tools/smg/src/command/analyze/root.zig:2
zig
pub const overview_command = @import("overview.zig");Audit
| Definitions | 2 |
|---|---|
| Public names | 3 |
| Members | 0 |
| Version | 26.7.0 |
| Revision | daab053ee433 |