1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-22 21:57:58 +01:00

don't specify Command usage strings when they match the default

This commit is contained in:
Doug Kearns
2007-07-19 15:23:42 +00:00
parent 9a09401004
commit 5607e0c6f6

View File

@@ -73,7 +73,7 @@ function Command(specs, action, extra_info) //{{{
this.action = action; this.action = action;
// TODO: build a better default usage string // TODO: build a better default usage string
this.usage = this.specs; this.usage = [this.specs[0]];
if (extra_info) if (extra_info)
{ {
@@ -197,7 +197,6 @@ function Commands() //{{{
addDefaultCommand(new Command(["addo[ns]"], addDefaultCommand(new Command(["addo[ns]"],
function() { openURLsInNewTab("chrome://mozapps/content/extensions/extensions.xul", true); }, function() { openURLsInNewTab("chrome://mozapps/content/extensions/extensions.xul", true); },
{ {
usage: ["addo[ns]"],
short_help: "Show available Browser Extensions and Themes", short_help: "Show available Browser Extensions and Themes",
help: "You can add/remove/disable browser extensions from this dialog.<br/>Be aware that not all Firefox extensions work, because Vimperator overrides some keybindings and changes Firefox's GUI." help: "You can add/remove/disable browser extensions from this dialog.<br/>Be aware that not all Firefox extensions work, because Vimperator overrides some keybindings and changes Firefox's GUI."
} }
@@ -228,7 +227,6 @@ function Commands() //{{{
addDefaultCommand(new Command(["beep"], addDefaultCommand(new Command(["beep"],
function() { vimperator.beep(); }, function() { vimperator.beep(); },
{ {
usage: ["beep"],
short_help: "Play a system beep" short_help: "Play a system beep"
} }
)); ));
@@ -342,7 +340,6 @@ function Commands() //{{{
} }
}, },
{ {
usage: ["buffers"],
short_help: "Show a list of all buffers (=tabs)", short_help: "Show a list of all buffers (=tabs)",
help: "If the list is already shown, close the preview window." help: "If the list is already shown, close the preview window."
} }
@@ -403,7 +400,6 @@ function Commands() //{{{
addDefaultCommand(new Command(["downl[oads]", "dl"], addDefaultCommand(new Command(["downl[oads]", "dl"],
function() { openURLsInNewTab("chrome://mozapps/content/downloads/downloads.xul", true); }, function() { openURLsInNewTab("chrome://mozapps/content/downloads/downloads.xul", true); },
{ {
usage: ["downl[oads]"],
short_help: "Show progress of current downloads", short_help: "Show progress of current downloads",
help: "Open the original Firefox download dialog in a new tab.<br/>" + help: "Open the original Firefox download dialog in a new tab.<br/>" +
"Here, downloads can be paused, canceled and resumed." "Here, downloads can be paused, canceled and resumed."
@@ -412,7 +408,6 @@ function Commands() //{{{
addDefaultCommand(new Command(["ec[ho]"], addDefaultCommand(new Command(["ec[ho]"],
function(args) { vimperator.echo(args); } , function(args) { vimperator.echo(args); } ,
{ {
usage: ["ec[ho]"],
short_help: "Display a string at the bottom of the window", short_help: "Display a string at the bottom of the window",
help: "Echo all arguments of this command. Useful for showing informational messages.<br/>Multiple lines WILL be separated by \\n." help: "Echo all arguments of this command. Useful for showing informational messages.<br/>Multiple lines WILL be separated by \\n."
} }
@@ -420,7 +415,6 @@ function Commands() //{{{
addDefaultCommand(new Command(["echoe[rr]"], addDefaultCommand(new Command(["echoe[rr]"],
function(args) { vimperator.echoerr(args); } , function(args) { vimperator.echoerr(args); } ,
{ {
usage: ["echoe[rr]"],
short_help: "Display an error string at the bottom of the window", short_help: "Display an error string at the bottom of the window",
help: "Echo all arguments of this command highlighted in red. Useful for showing important messages.<br/>Multiple lines WILL be separated by \\n." help: "Echo all arguments of this command highlighted in red. Useful for showing important messages.<br/>Multiple lines WILL be separated by \\n."
} }
@@ -436,7 +430,6 @@ function Commands() //{{{
addDefaultCommand(new Command(["exu[sage]"], addDefaultCommand(new Command(["exu[sage]"],
function(args, special, count, modifiers) { vimperator.help("commands", special, null, modifiers); }, function(args, special, count, modifiers) { vimperator.help("commands", special, null, modifiers); },
{ {
usage: ["exu[sage]"],
short_help: "Show help for Ex commands" short_help: "Show help for Ex commands"
} }
)); ));
@@ -458,7 +451,6 @@ function Commands() //{{{
addDefaultCommand(new Command(["ha[rdcopy]"], addDefaultCommand(new Command(["ha[rdcopy]"],
function() { getBrowser().contentWindow.print(); }, function() { getBrowser().contentWindow.print(); },
{ {
usage: ["ha[rdcopy]"],
short_help: "Print current document", short_help: "Print current document",
help: "Open a GUI dialog where you can select the printer, number of copies, orientation, etc." help: "Open a GUI dialog where you can select the printer, number of copies, orientation, etc."
} }
@@ -596,14 +588,12 @@ function Commands() //{{{
addDefaultCommand(new Command(["pc[lose]"], addDefaultCommand(new Command(["pc[lose]"],
function() { vimperator.previewwindow.hide(); }, function() { vimperator.previewwindow.hide(); },
{ {
usage: ["pc[lose]"],
short_help: "Close preview window on bottom of screen" short_help: "Close preview window on bottom of screen"
} }
)); ));
addDefaultCommand(new Command(["pref[erences]", "prefs"], addDefaultCommand(new Command(["pref[erences]", "prefs"],
openPreferences, openPreferences,
{ {
usage: ["pref[erences]"],
short_help: "Show Browser Preferences", short_help: "Show Browser Preferences",
help: "You can change the browser preferences from this dialog.<br/>Be aware that not all Firefox preferences work, because Vimperator overrides some keybindings and changes Firefox's GUI.<br/>" + help: "You can change the browser preferences from this dialog.<br/>Be aware that not all Firefox preferences work, because Vimperator overrides some keybindings and changes Firefox's GUI.<br/>" +
"Works like <code class=\"command\">:set!</code>, but opens the dialog in a new window instead of a new tab. Use this, if you experience problems/crashes when using <code class=\"command\">:set!</code>" "Works like <code class=\"command\">:set!</code>, but opens the dialog in a new window instead of a new tab. Use this, if you experience problems/crashes when using <code class=\"command\">:set!</code>"
@@ -612,7 +602,6 @@ function Commands() //{{{
addDefaultCommand(new Command(["q[uit]"], addDefaultCommand(new Command(["q[uit]"],
function() { vimperator.tabs.remove(getBrowser().mCurrentTab, 1, false, 1); }, function() { vimperator.tabs.remove(getBrowser().mCurrentTab, 1, false, 1); },
{ {
usage: ["q[uit]"],
short_help: "Quit current tab or quit Vimperator if this was the last tab", short_help: "Quit current tab or quit Vimperator if this was the last tab",
help: "When quitting Vimperator, the session is not stored." help: "When quitting Vimperator, the session is not stored."
} }
@@ -620,7 +609,6 @@ function Commands() //{{{
addDefaultCommand(new Command(["quita[ll]", "qa[ll]"], addDefaultCommand(new Command(["quita[ll]", "qa[ll]"],
function() { vimperator.quit(false); }, function() { vimperator.quit(false); },
{ {
usage: ["quita[ll]"],
short_help: "Quit Vimperator", short_help: "Quit Vimperator",
help: "Quit Vimperator, no matter how many tabs/windows are open. The session is not stored." help: "Quit Vimperator, no matter how many tabs/windows are open. The session is not stored."
} }
@@ -644,7 +632,6 @@ function Commands() //{{{
addDefaultCommand(new Command(["res[tart]"], addDefaultCommand(new Command(["res[tart]"],
function() { vimperator.restart(); }, function() { vimperator.restart(); },
{ {
usage: ["res[tart]"],
short_help: "Force the browser to restart", short_help: "Force the browser to restart",
help: "Useful when installing extensions." help: "Useful when installing extensions."
} }
@@ -652,7 +639,6 @@ function Commands() //{{{
addDefaultCommand(new Command(["sav[eas]"], addDefaultCommand(new Command(["sav[eas]"],
function() { saveDocument(window.content.document); }, function() { saveDocument(window.content.document); },
{ {
usage: ["sav[eas]"],
short_help: "Save current web page to disk", short_help: "Save current web page to disk",
help: "Open the original Firefox \"Save page as...\" dialog in a new tab.<br/>" + help: "Open the original Firefox \"Save page as...\" dialog in a new tab.<br/>" +
"There, you can save the current web page to disk with various options." "There, you can save the current web page to disk with various options."
@@ -795,7 +781,6 @@ function Commands() //{{{
addDefaultCommand(new Command(["st[op]"], addDefaultCommand(new Command(["st[op]"],
BrowserStop, BrowserStop,
{ {
usage: ["st[op]"],
short_help: "Stop loading", short_help: "Stop loading",
help: "Stop loading current web page." help: "Stop loading current web page."
} }
@@ -813,7 +798,6 @@ function Commands() //{{{
addDefaultCommand(new Command(["tabl[ast]"], addDefaultCommand(new Command(["tabl[ast]"],
function() { vimperator.tabs.select("$", false); }, function() { vimperator.tabs.select("$", false); },
{ {
usage: ["tabl[ast]"],
short_help: "Switch to the last tab" short_help: "Switch to the last tab"
} }
)); ));
@@ -829,7 +813,6 @@ function Commands() //{{{
addDefaultCommand(new Command(["tabn[ext]", "tn[ext]"], addDefaultCommand(new Command(["tabn[ext]", "tn[ext]"],
function() { vimperator.tabs.select("+1", true); }, function() { vimperator.tabs.select("+1", true); },
{ {
usage: ["tabn[ext]"],
short_help: "Switch to the next tab", short_help: "Switch to the next tab",
help: "Cycles to the first tab, when the last is selected." help: "Cycles to the first tab, when the last is selected."
} }
@@ -837,7 +820,6 @@ function Commands() //{{{
addDefaultCommand(new Command(["tabo[nly]"], addDefaultCommand(new Command(["tabo[nly]"],
function() { vimperator.tabs.keepOnly(getBrowser().mCurrentTab); }, function() { vimperator.tabs.keepOnly(getBrowser().mCurrentTab); },
{ {
usage: ["tabo[nly]"],
short_help: "Close all other tabs" short_help: "Close all other tabs"
} }
)); ));
@@ -905,7 +887,6 @@ function Commands() //{{{
addDefaultCommand(new Command(["qmarks", "qms"], addDefaultCommand(new Command(["qmarks", "qms"],
function(args) { vimperator.quickmarks.list(args); }, function(args) { vimperator.quickmarks.list(args); },
{ {
usage: ["qmarks"],
short_help: "Show marked URLs", short_help: "Show marked URLs",
help: "TODO." help: "TODO."
} }
@@ -927,7 +908,6 @@ function Commands() //{{{
addDefaultCommand(new Command(["viu[sage]"], addDefaultCommand(new Command(["viu[sage]"],
function(args, special, count, modifiers) { vimperator.help("mappings", special, null, modifiers); }, function(args, special, count, modifiers) { vimperator.help("mappings", special, null, modifiers); },
{ {
usage: ["viu[sage]"],
short_help: "Show help for normal mode commands" short_help: "Show help for normal mode commands"
} }
)); ));
@@ -939,7 +919,7 @@ function Commands() //{{{
help: "Not implemented yet." help: "Not implemented yet."
} }
)); ));
addDefaultCommand(new Command(["xa[ll]", "wqa[ll]", "wq"], addDefaultCommand(new Command(["wqa[ll]", "wq", "xa[ll]"],
function() { vimperator.quit(true); }, function() { vimperator.quit(true); },
{ {
usage: ["wqa[ll]", "xa[ll]"], usage: ["wqa[ll]", "xa[ll]"],