code: def validate_args(self) -> None:
      from dvc.exceptions import InvalidArgumentError
  
      args = self.args
      invalid_opt = None
  
      if args.to_remote or args.out:
          message = "{option} can't be used with "
          message += "--to-remote" if args.to_remote else "--out"
          if len(args.targets) != 1:
              invalid_opt = "multiple targets"
          elif args.glob:
              invalid_opt = "--glob option"
          elif args.no_commit:
              invalid_opt = "--no-commit option"
      else:
          message = "{option} can't be used without --to-remote"
          if args.remote:
              invalid_opt = "--remote"
          elif args.remote_jobs:
              invalid_opt = "--remote-jobs"
  
      if invalid_opt is not None:
          raise InvalidArgumentError(message.format(option=invalid_opt))
  
file_path: dvc/dvc/commands/add.py
imports: from dvc.cli import completion, formatter
  from dvc.cli.command import CmdBase
  from dvc.cli.utils import append_doc_link
  from dvc.log import logger
label_desc: Use image node_id 1 for calling the CmdAdd obj's underlying member method code with example usage: obj.validate_args() without return types