type enum choice

Mode: Operational Mode


An enumerated type in DDL is analogous to that in C and other languages: it permits any of several specified values to be used for a given object or attribute. The values are specified using the choice statement.

Using choice with type enum limits the subordinates available under an argument.

For type enum string, it provides the list of acceptable string choices predefined by the programmer.


            command newbie {
                help "Show newbie";

                argument usergroup {
                    help "Check user group";
                    type enum string {
                        choice ipg-all {
                            help "All IPG subscribes this";
                        choice hw {
                            help "Only HW subscribes this";
                        choice sw {
                            help "Only SW subscribes this";


        user@router> show example newbie ?
        Possible completions:
          <[Enter]>            Execute this command
          usergroup            Check user group
          |                    Pipe through a command
        user@router> show example newbie usergroup ?
        Possible completions:
          hw                   Only HW subscribes this
          ipg-all              All IPG subscribes this
          sw                   Only SW subscribes this
        user@router> show example newbie usergroup hw 


See also:

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:13 2010 for DDL Reference Guide by doxygen 1.4.5