type toggle

Mode: Operational Mode

Description:

The toggle type acts as a binary choice type, accepting only 2 values internally: on and off. Use the toggle type to specify switches.

Since there are only 2 acceptable values, using the argument sets the on state of the argument. It is redundant to require users to type in the value 'on'. Hence, no values are required and allowed after the argument keyword is entered.

Example:

            command newbie {
                help "Show newbie";
                EXAMPLED_ACTION;

                argument logged-on {
                    help "Check if user is logged on";
                    type toggle;
                }
            }

Display:

        user@router> show example newbie ?
        Possible completions:
          <[Enter]>            Execute this command
          logged-on            Check if user is logged on
          |                    Pipe through a command
        user@router> show example newbie logged-on 

        user@router>

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