Update argparse4j

This commit is contained in:
AsamK 2021-05-13 18:06:57 +02:00
parent 06e9f8ba64
commit 8e8eed7b06
10 changed files with 21 additions and 18 deletions

View file

@ -54,7 +54,7 @@ public class DaemonCommand implements MultiLocalCommand {
logger.warn("\"--json\" option has been deprecated, please use the global \"--output=json\" instead.");
}
boolean ignoreAttachments = ns.getBoolean("ignore_attachments");
boolean ignoreAttachments = ns.getBoolean("ignore-attachments");
DBusConnection.DBusBusType busType;
if (ns.getBoolean("system")) {
@ -88,7 +88,7 @@ public class DaemonCommand implements MultiLocalCommand {
logger.warn("\"--json\" option has been deprecated, please use the global \"--output=json\" instead.");
}
boolean ignoreAttachments = ns.getBoolean("ignore_attachments");
boolean ignoreAttachments = ns.getBoolean("ignore-attachments");
DBusConnection.DBusBusType busType;
if (ns.getBoolean("system")) {

View file

@ -155,7 +155,7 @@ public class ReceiveCommand implements ExtendedDbusCommand, LocalCommand {
returnOnTimeout = false;
timeout = 3600;
}
boolean ignoreAttachments = ns.getBoolean("ignore_attachments");
boolean ignoreAttachments = ns.getBoolean("ignore-attachments");
try {
final var handler = inJson ? new JsonReceiveMessageHandler(m) : new ReceiveMessageHandler(m);
m.receiveMessages((long) (timeout * 1000),

View file

@ -41,7 +41,7 @@ public class RemoteDeleteCommand implements DbusCommand {
throw new UserErrorException("You cannot specify recipients by phone number and groups at the same time");
}
final long targetTimestamp = ns.getLong("target_timestamp");
final long targetTimestamp = ns.getLong("target-timestamp");
final var writer = new PlainTextWriterImpl(System.out);

View file

@ -47,7 +47,7 @@ public class SendCommand implements DbusCommand {
final List<String> recipients = ns.getList("recipient");
final var isEndSession = ns.getBoolean("endsession");
final var groupIdString = ns.getString("group");
final var isNoteToSelf = ns.getBoolean("note_to_self");
final var isNoteToSelf = ns.getBoolean("note-to-self");
final var noRecipients = recipients == null || recipients.isEmpty();
if ((noRecipients && isEndSession) || (noRecipients && groupIdString == null && !isNoteToSelf)) {

View file

@ -51,8 +51,8 @@ public class SendReactionCommand implements DbusCommand {
final var emoji = ns.getString("emoji");
final boolean isRemove = ns.getBoolean("remove");
final var targetAuthor = ns.getString("target_author");
final long targetTimestamp = ns.getLong("target_timestamp");
final var targetAuthor = ns.getString("target-author");
final long targetTimestamp = ns.getLong("target-timestamp");
final var writer = new PlainTextWriterImpl(System.out);

View file

@ -28,7 +28,7 @@ public class TrustCommand implements LocalCommand {
@Override
public void handleCommand(final Namespace ns, final Manager m) throws CommandException {
var number = ns.getString("number");
if (ns.getBoolean("trust_all_known_keys")) {
if (ns.getBoolean("trust-all-known-keys")) {
boolean res;
try {
res = m.trustIdentityAllKeys(number);
@ -39,7 +39,7 @@ public class TrustCommand implements LocalCommand {
throw new UserErrorException("Failed to set the trust for this number, make sure the number is correct.");
}
} else {
var safetyNumber = ns.getString("verified_safety_number");
var safetyNumber = ns.getString("verified-safety-number");
if (safetyNumber != null) {
safetyNumber = safetyNumber.replaceAll(" ", "");
if (safetyNumber.length() == 66) {

View file

@ -23,7 +23,7 @@ public class UnregisterCommand implements LocalCommand {
@Override
public void handleCommand(final Namespace ns, final Manager m) throws CommandException {
try {
if (ns.getBoolean("delete_account")) {
if (ns.getBoolean("delete-account")) {
m.deleteAccount();
} else {
m.unregister();

View file

@ -30,12 +30,12 @@ public class UpdateProfileCommand implements LocalCommand {
@Override
public void handleCommand(final Namespace ns, final Manager m) throws CommandException {
var givenName = ns.getString("given_name");
var familyName = ns.getString("family_name");
var givenName = ns.getString("given-name");
var familyName = ns.getString("family-name");
var about = ns.getString("about");
var aboutEmoji = ns.getString("about_emoji");
var aboutEmoji = ns.getString("about-emoji");
var avatarPath = ns.getString("avatar");
boolean removeAvatar = ns.getBoolean("remove_avatar");
boolean removeAvatar = ns.getBoolean("remove-avatar");
Optional<File> avatarFile = removeAvatar
? Optional.absent()