diff --git a/Scripts/Functions/Help/help.sh b/Scripts/Functions/Help/help.sh index c8c9e32..4490be5 100755 --- a/Scripts/Functions/Help/help.sh +++ b/Scripts/Functions/Help/help.sh @@ -44,6 +44,15 @@ function help { # are `cap-first-only' and `directory'. local FLAG_STYLE='cap-each-word' + # Initialize the sort flag (`--sort'). This option controls the + # order used to build entries inside section menus. Possible + # arguments to this option are `ordered', `reversed', `created'. + # From these three values `created' is used by default (i.e., new + # menu entries are added as last menu entry.). Notice that, once + # you've sorted the menu, it is hard to sort the list back to + # former creation orders. Go sorted or not sorted at all. + local FLAG_SORT='created' + # Initialize manual's language. local MANUAL_L10N=$(cli_getCurrentLocale) diff --git a/Scripts/Functions/Help/help_getOptions.sh b/Scripts/Functions/Help/help_getOptions.sh index 5647eb7..ae518db 100755 --- a/Scripts/Functions/Help/help_getOptions.sh +++ b/Scripts/Functions/Help/help_getOptions.sh @@ -30,7 +30,7 @@ function help_getOptions { local ARGSS="" # Define long options we want to support. - local ARGSL="quiet,answer-yes,dont-commit-changes,backend:,read,search:,edit,update,copy,delete,rename,style:" + local ARGSL="quiet,answer-yes,dont-commit-changes,backend:,read,search:,edit,update,copy,delete,rename,style:,sort:" # Parse arguments using getopt(1) command parser. cli_parseArguments @@ -109,6 +109,11 @@ function help_getOptions { shift 2 ;; + --sort ) + FLAG_SORT="$2" + shift 2 + ;; + -- ) # Remove the `--' argument from the list of arguments # in order for processing non-option arguments