- @Override
- public void attachToSubparser(final Subparser subparser) {
- subparser.addArgument("-g", "--group")
- .help("Specify the recipient group ID.");
- subparser.addArgument("recipient")
- .help("Specify the recipients' phone number.")
- .nargs("*");
- subparser.addArgument("-m", "--message")
- .help("Specify the message, if missing standard input is used.");
- subparser.addArgument("-a", "--attachment")
- .nargs("*")
- .help("Add file as attachment");
- subparser.addArgument("-e", "--endsession")
+ private final static Logger logger = LoggerFactory.getLogger(SendCommand.class);
+ private final OutputWriter outputWriter;
+
+ public SendCommand(final OutputWriter outputWriter) {
+ this.outputWriter = outputWriter;
+ }
+
+ public static void attachToSubparser(final Subparser subparser) {
+ subparser.help("Send a message to another user or group.");
+ subparser.addArgument("recipient").help("Specify the recipients' phone number.").nargs("*");
+ final var mutuallyExclusiveGroup = subparser.addMutuallyExclusiveGroup();
+ mutuallyExclusiveGroup.addArgument("-g", "--group-id", "--group").help("Specify the recipient group ID.");
+ mutuallyExclusiveGroup.addArgument("--note-to-self")
+ .help("Send the message to self without notification.")
+ .action(Arguments.storeTrue());
+
+ subparser.addArgument("-m", "--message").help("Specify the message, if missing standard input is used.");
+ subparser.addArgument("-a", "--attachment").nargs("*").help("Add file as attachment");
+ subparser.addArgument("-e", "--end-session", "--endsession")