Skip to content

Commit

Permalink
feat: add hyper completion spec (withfig#508)
Browse files Browse the repository at this point in the history
* feat: add hyper completion spec

* feat: add folders template

* feat: add desc for search args

* feat: add generator to uninstall plugin

* fix(hyper): eslint rules

Co-authored-by: QuiiBz <[email protected]>
  • Loading branch information
Deep-Codes and QuiiBz committed Aug 28, 2021
1 parent d82672d commit 7e4fdb6
Showing 1 changed file with 76 additions and 0 deletions.
76 changes: 76 additions & 0 deletions dev/hyper.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
const completionSpec: Fig.Spec = {
name: "hyper",
description: "Hyper is an Electron-based terminal",
args: {
template: "folders",
},
subcommands: [
{
name: ["install", "i"],
description: "Install a plugin",
args: {
name: "plugin",
},
},
{
name: ["docs", "d", "h", "home"],
description: "Open the npm page of a plugin",
args: {
name: "plugin",
},
},
{
name: "help",
description: "Display help",
},
{
name: ["list", "ls"],
description: "List installed plugins",
},
{
name: ["list-remote", "lsr", " ls-remote"],
description: "List plugins available on npm",
},
{
name: ["search", "s"],
description: "Search for plugins on npm",
args: {
isOptional: true,
name: "query",
description: "Your search query",
},
},
{
name: ["uninstall", "u", "rm", "remove"],
description: "Uninstall plugin",
args: {
name: "plugin",
description: "Plugin to uninstall",
generators: {
script: "hyper list",
postProcess: function (out) {
return out.split("\n").map((p) => {
return { name: p, description: "Plugin name" };
});
},
},
},
},
{
name: "version",
description: "Show version",
},
],
options: [
{
name: ["-h", "--help"],
description: `Output usage information`,
},
{
name: ["-v", "--verbose"],
description: `Verbose mode (disabled by default)`,
},
],
};

export default completionSpec;

0 comments on commit 7e4fdb6

Please sign in to comment.