Mmuzaf commented on code in PR #2497: URL: https://github.com/apache/cassandra/pull/2497#discussion_r2198153121
########## src/java/org/apache/cassandra/tools/nodetool/Repair.java: ########## @@ -27,96 +27,104 @@ import com.google.common.collect.Sets; import org.apache.commons.lang3.StringUtils; -import io.airlift.airline.Arguments; -import io.airlift.airline.Cli; -import io.airlift.airline.Command; -import io.airlift.airline.Option; import org.apache.cassandra.repair.RepairParallelism; import org.apache.cassandra.repair.messages.RepairOption; import org.apache.cassandra.schema.SchemaConstants; import org.apache.cassandra.streaming.PreviewKind; import org.apache.cassandra.tools.NodeProbe; -import org.apache.cassandra.tools.NodeTool.NodeToolCmd; +import org.apache.cassandra.tools.nodetool.layout.CassandraUsage; +import picocli.CommandLine.Command; +import picocli.CommandLine.Option; +import picocli.CommandLine.Parameters; import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.collect.Lists.newArrayList; +import static org.apache.cassandra.tools.nodetool.CommandUtils.concatArgs; +import static org.apache.cassandra.tools.nodetool.CommandUtils.parseOptionalKeyspaceNonLocal; +import static org.apache.cassandra.tools.nodetool.CommandUtils.parseOptionalTables; import static org.apache.commons.lang3.StringUtils.EMPTY; @Command(name = "repair", description = "Repair one or more tables") -public class Repair extends NodeToolCmd +public class Repair extends AbstractCommand { public final static Set<String> ONLY_EXPLICITLY_REPAIRED = Sets.newHashSet(SchemaConstants.DISTRIBUTED_KEYSPACE_NAME); - @Arguments(usage = "[<keyspace> <tables>...]", description = "The keyspace followed by one or many tables") + @CassandraUsage(usage = "[<keyspace> <tables>...]", description = "The keyspace followed by one or many tables") private List<String> args = new ArrayList<>(); - @Option(title = "seqential", name = {"-seq", "--sequential"}, description = "Use -seq to carry out a sequential repair") + @Parameters(index = "0", description = "The keyspace followed by one or many tables", arity = "0..1") + private String keyspace; + + @Parameters(index = "1..*", description = "Tables to repair", arity = "0..1") Review Comment: Fixed. ########## src/java/org/apache/cassandra/tools/nodetool/Scrub.java: ########## @@ -17,53 +17,61 @@ */ package org.apache.cassandra.tools.nodetool; -import io.airlift.airline.Arguments; -import io.airlift.airline.Command; -import io.airlift.airline.Option; - import java.util.ArrayList; import java.util.List; import org.apache.cassandra.tools.NodeProbe; -import org.apache.cassandra.tools.NodeTool.NodeToolCmd; import org.apache.cassandra.tools.StandaloneScrubber; +import org.apache.cassandra.tools.nodetool.layout.CassandraUsage; +import picocli.CommandLine.Command; +import picocli.CommandLine.Option; +import picocli.CommandLine.Parameters; + +import static org.apache.cassandra.tools.nodetool.CommandUtils.concatArgs; @Command(name = "scrub", description = "Scrub (rebuild sstables for) one or more tables") -public class Scrub extends NodeToolCmd +public class Scrub extends AbstractCommand { - @Arguments(usage = "[<keyspace> <tables>...]", description = "The keyspace followed by one or many tables") + @CassandraUsage(usage = "[<keyspace> <tables>...]", description = "The keyspace followed by one or many tables") private List<String> args = new ArrayList<>(); - @Option(title = "disable_snapshot", - name = {"-ns", "--no-snapshot"}, + @Parameters(index = "0", description = "The keyspace followed by one or many tables", arity = "0..1") + private String keyspace; + + @Parameters(index = "1..*", description = "The tables to scrub", arity = "0..1") Review Comment: Fixed. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org For additional commands, e-mail: pr-h...@cassandra.apache.org