flag positional

Mode: Operational Mode

Description:

With argument keywords, users are allowed to specify arguments in any order. The positional flag specifies that all child entities must be displayed in the specified order, and all of those entities are mandatory.

This flag is only useful when more than 1 argument has the nokeyword flag specified.

'flag positional' should be avoided. One of the strengths of JUNOS is the flexibility to specify arguments in any order. It should only be used when not naming the keywords for more than 1 argument makes sense.

For example:

file copy [<source>] [<destination>]

Example:

src/junos/lib/ddl/input/file.cmd.dd


        command file {
            help "Perform file operations";

            ....

            argument copy {
                alias "cp";
                help "Copy files (local or remote)";
                flag positional;

                    argument source {
                        help "Source URL";
                        flag nokeyword positional;
                        type string;
                        action expand mgd mgd_expand_user_file;
                    }

                argument destination {
                    help "Destination URL";
                    flag nokeyword positional;
                    type string;
                    action expand mgd mgd_expand_user_file;
                }
            }
        }

Display:

        user@router> file copy ?
        Possible completions:
          <source>              Source URL
        user@router> file copy user_router.conf ?
        Possible completions:
          <destination>         Destination URL
        user@router> file copy user_router.conf /var/tmp/user_router.conf
        Possible completions:
          <[Enter]>             Execute this command
        |                       Pipe through a command
        user@router>

Topics for further reading:

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