flag autosort

Mode: Configuration Mode

Description:

Without flag autosort, the configuration knobs are listed in the same order as in the ddl input file; with flag autosort, the configuration knobs are presented as a sorted list when help messages are displayed, regardless of the attribute types.

This flag is applied to the parent object (object or choice or type enum unit) where the children need to be sorted.

Although the attribute naming restriction is that names have to be unique case-insensitively, autosort sorts the knobs taking the cases into account.

Example 1:

        object newbie {
            help "Newbie settings";
            flag autosort;

            attribute e {
                help "Help section e";
                type toggle;
            }
            attribute C {
                help "Help section C (sorting is case sensitive!)";
                type toggle;
            }
            attribute a {
                help "Help section a";
                type uint;
            }
        }

Display:

        user@router# set example newbie ?
        Possible completions:
          <[Enter]>            Execute this command
          C                    Help section C (case-insensitive!)
          a                    Help section a
        + apply-groups         Groups from which to inherit configuration data
        + apply-groups-except  Don't inherit configuration data from these groups
          e                    Help section e
          |                    Pipe through a command
        [edit]

Example 2:

        object newbie {
            /* Test flag autosort */
            help "Newbie settings";
            flag autosort;

            choice example-sort {
                attribute e {
                    help "Help section e";
                    type toggle;
                }
                attribute C {
                    help "Help section C (sorting is case sensitive!)";
                    type toggle;
                }
                attribute a {
                    help "Help section a";
                    type uint;
                }
            }
        }

Display 2:

        user@router# set example newbie ?
        Possible completions:
          <[Enter]>            Execute this command
          C                    Help section C (case-insensitive!)
          a                    Help section a
        + apply-groups         Groups from which to inherit configuration data
        + apply-groups-except  Don't inherit configuration data from these groups
          e                    Help section e
          |                    Pipe through a command
        [edit]

Example 3:

        object newbie {
            /* Test flag autosort */
            help "Newbie settings";

            attribute example-sort {
                flag autosort;
                type enum uint {
                    choice e {
                        help "Help section e";
                    }
                    choice C {
                        help "Help section C (sorting is case sensitive!)";
                    }
                    choice a {
                        help "Help section a";
                    }
                }
            }
        }

Display 3:

        user@router# set example newbie example-sort ?
        Possible completions:
          C                    Help section C (sorting is case sensitive!)
          a                    Help section a
          e                    Help section e
        [edit]

Topics for further reading:

See also:
choice

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