Class BuckArgsMethods

  • public class BuckArgsMethods
    extends Object
    Utility class for methods related to args handling.
    • Method Detail

      • expandAtFiles

        public static<String> expandAtFiles​(Iterable<String> args,
                                                                          <CellName,​AbsPath> cellMapping)
        Expand AT-file syntax in a way that matches what args4j does. We have this because we'd like to correctly log the arguments coming from the AT-files and there is no way to get the expanded args array from args4j.

        In addition to files passed using a regular @ syntax, this method also extracts command line arguments from AT-file syntax files passed via --flagfile command line option.

        args - original args array
        cellMapping - a map from cell names to their roots
        args array with AT-files expanded.
      • filterArgs

        public static<String> filterArgs​(List<String> args,
                                                                       <String> optionsToSkip)
        Drops options from the args array.
        args - args array.
        optionsToSkip - if args contains an element from this array skip the element and the element immediately after it.
        filtered args array