Home | History | Annotate | Download | only in options
      1 // Copyright 2017 The Bazel Authors. All rights reserved.
      2 //
      3 // Licensed under the Apache License, Version 2.0 (the "License");
      4 // you may not use this file except in compliance with the License.
      5 // You may obtain a copy of the License at
      6 //
      7 //    http://www.apache.org/licenses/LICENSE-2.0
      8 //
      9 // Unless required by applicable law or agreed to in writing, software
     10 // distributed under the License is distributed on an "AS IS" BASIS,
     11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     12 // See the License for the specific language governing permissions and
     13 // limitations under the License.
     14 package com.google.devtools.common.options;
     15 
     16 /**
     17  * On top of categorizing options by their intended purpose, these tags should identify options that
     18  * are either not supported or are intended to break old behavior.
     19  */
     20 public enum OptionMetadataTag {
     21   /**
     22    * This option triggers an experimental feature with no guarantees of functionality.
     23    *
     24    * <p>Note: this is separate from UNDOCUMENTED flags, which are flags we don't want listed and
     25    * shouldn't be widely used. Experimental flags should probably also be undocumented, but not all
     26    * undocumented flags should be labeled experimental.
     27    */
     28   EXPERIMENTAL(0),
     29 
     30   /**
     31    * This option triggers a backwards-incompatible change. It will be off by default when the option
     32    * is first introduced, and later switched on by default on a major Blaze release. Use this option
     33    * to test your migration readiness or get early access to the feature. The option may be
     34    * deprecated some time after the feature's release.
     35    */
     36   INCOMPATIBLE_CHANGE(1),
     37 
     38   /**
     39    * This flag is deprecated. It might either no longer have any effect, or might no longer be
     40    * supported.
     41    */
     42   DEPRECATED(2),
     43 
     44   /**
     45    * These are flags that should never be set by a user. This tag is used to make sure that options
     46    * that form the protocol between the client and the server are not logged.
     47    *
     48    * <p>These should be in category {@code OptionDocumentationCategory.UNDOCUMENTED}.
     49    */
     50   HIDDEN(3),
     51 
     52   /**
     53    * Options which are INTERNAL are not recognized by the parser at all, and so cannot be used as
     54    * flags.
     55    *
     56    * <p>These should be in category {@code OptionDocumentationCategory.UNDOCUMENTED}.
     57    */
     58   INTERNAL(4);
     59 
     60   private final int value;
     61 
     62   OptionMetadataTag(int value) {
     63     this.value = value;
     64   }
     65 
     66   public int getValue() {
     67     return value;
     68   }
     69 }
     70