27 lines
927 B
Java
27 lines
927 B
Java
package com.agenticcode.cli;
|
|
|
|
import org.jspecify.annotations.Nullable;
|
|
import picocli.CommandLine.Command;
|
|
import picocli.CommandLine.Option;
|
|
|
|
/**
|
|
* Item 194: the frontend Redux store — its slices, their state keys and access counts.
|
|
*/
|
|
@Command(name = "store", mixinStandardHelpOptions = true,
|
|
description = "List the project's Redux store slices (reducer key, state keys with types and read/write counts, reducers)")
|
|
final class StoreCommand extends AbstractProjectCommand {
|
|
|
|
@Option(names = "--slice", description = "Only this slice (reducer key or RTK slice name)")
|
|
@Nullable String slice;
|
|
|
|
@Override
|
|
public Integer call() throws Exception {
|
|
try {
|
|
return printResponse(apiClient().get(appendQuery(projectPath() + "/store", "slice", slice)));
|
|
} catch (IllegalStateException e) {
|
|
System.err.println(e.getMessage());
|
|
return 1;
|
|
}
|
|
}
|
|
}
|