choice

Mode: Configuration Mode

Description:

choice allows users to configure only one of the object or attribute choices defined under it. Since only one of the choices can be used, users configuring a different choice will erase any existing choices already specified.

This should not be confused with the other usage of the keyword choice used with conjunction with type enum.

(Note: nesting of choice is not allowed because it is associative, it is the same as offering all the choices at the top level.)

Example:

        object newbie {
            help "Newbie settings";

            choice number {
                help "Number configuration";
                attribute single-digit {
                    help "Single-digit number";
                    type ranged ushort 0 .. 9;
                }
                attribute double-digit {
                    help "Double-digit number";
                    type ranged ushort 10 .. 99;
                }
            }
        }

Display:

        user@router# set example newbie ?
        Possible completions:
          <[Enter]>            Execute this command
        + apply-groups         Groups from which to inherit configuration data
        + apply-groups-except  Don't inherit configuration data from these groups
          double-digit         Double-digit number (10..99)
          single-digit         Single-digit number (0..9)
          |                    Pipe through a command
        [edit]
        user@router# set example newbie double-digit 11 

        [edit]
        user@router# commit

        [edit]
        user@router# show
        version "8.2I0 [user]";
        example {
            newbie {
                double-digit 11;
            }
        }

        [edit]
        user@router# show 
        version "8.2I0 [user]";
        example {
            newbie {
                double-digit 11;
            }
        }

        [edit]
        user@router# set example newbie single-digit 8  

        [edit]
        user@router# commit         
        commit complete

        [edit]
        user@router# show 
        version "8.2I0 [user]";
        example {
            newbie {
                single-digit 8;
            }
        }

        [edit]

See also:
type_enum_choice.cfg

Reference (to programmers guide/style guide):


2007-2008 Juniper Networks, Inc. All rights reserved. The information contained herein is confidential information of Juniper Networks, Inc., and may not be used, disclosed, distributed, modified, or copied without the prior written consent of Juniper Networks, Inc. in an express license. This information is subject to change by Juniper Networks, Inc. Juniper Networks, the Juniper Networks logo, and JUNOS are trademarks of Juniper Networks, Inc.
Generated on Sun May 30 20:23:12 2010 for DDL Reference Guide by doxygen 1.4.5