code: private static String[] addSrcBeforeDirectories(String[] args) {
          List<String> newargs = new ArrayList<String>();
          for (int i = 0; i<args.length; ++i) {
              File dir = new File(args[i]);
              if (dir.exists() && dir.isDirectory()) {
                  if (i == 0 || !shouldBeFollowedByPath(args[i-1])) {
                      newargs.add("-src");
                  }
              }
              newargs.add(args[i]);
          }
          return newargs.toArray(new String[0]);
      }
docs: Add -src before source root directories if not already there.