diff --git a/common/content/commands.js b/common/content/commands.js index 69ada697..0b2b1366 100644 --- a/common/content/commands.js +++ b/common/content/commands.js @@ -1018,10 +1018,11 @@ function Commands() //{{{ if (args.literalArg) { - let nargsOpt = args["-nargs"] || "0"; - let bangOpt = "-bang" in args; - let countOpt = "-count" in args; - let completeOpt = args["-complete"]; + let nargsOpt = args["-nargs"] || "0"; + let bangOpt = "-bang" in args; + let countOpt = "-count" in args; + let descriptionOpt = args["-description"] || "User-defined command"; + let completeOpt = args["-complete"]; let completeFunc = null; // default to no completion for user commands @@ -1054,7 +1055,7 @@ function Commands() //{{{ } let added = commands.addUserCommand([cmd], - "User defined command", + descriptionOpt, userCommand, { argCount: nargsOpt, @@ -1106,6 +1107,7 @@ function Commands() //{{{ function (arg) /^[01*?+]$/.test(arg), ["0", "1", "*", "?", "+"]], [["-bang"], self.OPTION_NOARG], [["-count"], self.OPTION_NOARG], + [["-description"], self.OPTION_STRING], // TODO: "E180: invalid complete value: " + arg [["-complete"], self.OPTION_STRING, function (arg) arg in completeOptionMap || /custom,\w+/.test(arg), diff --git a/vimperator/NEWS b/vimperator/NEWS index 8bd34a02..59d4c063 100644 --- a/vimperator/NEWS +++ b/vimperator/NEWS @@ -2,9 +2,10 @@ * version 2.2a1pre * IMPORTANT: shifted key notation now matches Vim's behaviour. E.g. and are equivalent, to map the uppercase character use . + * add -description option to :command * command-line options are now supported via the host application's -liberator option - * add :i and :I for opening image location (in new tab) + * add ;i and ;I for opening image location (in new tab) * add all.html to show all help sections in a single page - available via :help all * add ;c extended hint mode - open the context menu diff --git a/vimperator/locale/en-US/map.txt b/vimperator/locale/en-US/map.txt index b548e9a9..c8ceac44 100644 --- a/vimperator/locale/en-US/map.txt +++ b/vimperator/locale/en-US/map.txt @@ -375,6 +375,12 @@ By default a user command does not have a special version, i.e. a version executed with the ! modifier. Providing the -bang attribute will enable this and will be available in the argument. +|:command-description| + +Command description + +The command's description text can be set with -description. Otherwise it will +default to "User-defined command". + |:command-replacement-text| + Replacement text diff --git a/xulmus/locale/en-US/map.txt b/xulmus/locale/en-US/map.txt index 79341a5f..aae4407b 100644 --- a/xulmus/locale/en-US/map.txt +++ b/xulmus/locale/en-US/map.txt @@ -375,6 +375,12 @@ By default a user command does not have a special version, i.e. a version executed with the ! modifier. Providing the -bang attribute will enable this and will be available in the argument. +|:command-description| + +Command description + +The command's description text can be set with -description. Otherwise it will +default to "User-defined command". + |:command-replacement-text| + Replacement text