- if ("link".equals(ns.getString("command"))) {
- if (ns.getString("username") != null) {
- parser.printUsage();
- System.err.println("You cannot specify a username (phone number) when linking");
- System.exit(2);
- }
- } else if (!ns.getBoolean("dbus") && !ns.getBoolean("dbus_system")) {
- if (ns.getString("username") == null) {
- parser.printUsage();
- System.err.println("You need to specify a username (phone number)");
- System.exit(2);
- }
- if (!PhoneNumberFormatter.isValidNumber(ns.getString("username"), null)) {
- System.err.println("Invalid username (phone number), make sure you include the country code.");
- System.exit(2);
- }
- }
-
- if (ns.getList("recipient") != null && !ns.getList("recipient").isEmpty() && ns.getString("group") != null) {
- System.err.println("You cannot specify recipients by phone number and groups at the same time");
- System.exit(2);
- }
-