Refactor command creation

This commit is contained in:
AsamK 2021-08-20 18:42:38 +02:00
parent 47143a90e1
commit af292d8f0e
45 changed files with 436 additions and 282 deletions

View file

@ -4,7 +4,6 @@ import net.sourceforge.argparse4j.impl.Arguments;
import net.sourceforge.argparse4j.inf.Namespace;
import net.sourceforge.argparse4j.inf.Subparser;
import org.asamk.signal.OutputWriter;
import org.asamk.signal.commands.exceptions.CommandException;
import org.asamk.signal.commands.exceptions.IOErrorException;
import org.asamk.signal.commands.exceptions.UserErrorException;
@ -15,10 +14,13 @@ import java.io.IOException;
public class RegisterCommand implements RegistrationCommand {
public RegisterCommand(final OutputWriter outputWriter) {
@Override
public String getName() {
return "register";
}
public static void attachToSubparser(final Subparser subparser) {
@Override
public void attachToSubparser(final Subparser subparser) {
subparser.help("Register a phone number with SMS or voice verification.");
subparser.addArgument("-v", "--voice")
.help("The verification should be done over voice, not SMS.")