refactor(commands): separate commands and its core into two folders (#32)
- I think it would be better if one for commands only, one for the spec handling core logic so people won't be confused by the core logic inside the commands folder (cleaner I guess) - Regen docs
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
package view
|
||||
|
||||
import (
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "bat",
|
||||
Description: "A cat(1) clone with syntax highlighting and Git integration",
|
||||
Options: []core.Option{
|
||||
Options: []spec.Option{
|
||||
{Name: "-A", Description: "Show non-printable characters"},
|
||||
{Name: "-p", Description: "Show plain style, no decorations"},
|
||||
{Name: "-l", Description: "Explicitly set the language for syntax highlighting"},
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
package view
|
||||
|
||||
import (
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "cat",
|
||||
Description: "concatenate and print",
|
||||
Generator: core.FileGenerator(),
|
||||
Options: []core.Option{
|
||||
Generator: spec.FileGenerator(),
|
||||
Options: []spec.Option{
|
||||
{Name: "-n", Description: "number lines"},
|
||||
{Name: "-b", Description: "number non-blank"},
|
||||
},
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package view
|
||||
|
||||
import (
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "code",
|
||||
Description: "Read from stdin (e.g.",
|
||||
Options: []core.Option{
|
||||
Options: []spec.Option{
|
||||
{Name: "-d", Description: "Compare two files with each other"},
|
||||
{Name: "-m", Description: "Add folder(s) to the last active window"},
|
||||
{Name: "-g", Description: "Open a file at the path on the specified line and character position"},
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package view
|
||||
|
||||
import (
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "cot",
|
||||
Description: "Command-line utility for CotEditor",
|
||||
})
|
||||
|
||||
+4
-4
@@ -1,15 +1,15 @@
|
||||
package view
|
||||
|
||||
import (
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "du",
|
||||
Description: "estimate file space usage",
|
||||
Generator: core.FileGenerator(),
|
||||
Options: []core.Option{
|
||||
Generator: spec.FileGenerator(),
|
||||
Options: []spec.Option{
|
||||
{Name: "-h", Description: "human readable"},
|
||||
{Name: "-s", Description: "summarize"},
|
||||
{Name: "-a", Description: "all files"},
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package view
|
||||
|
||||
import (
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "emacs",
|
||||
Description: "An extensible, customizable, free/libre text editor - and more",
|
||||
})
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package view
|
||||
|
||||
import (
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "file",
|
||||
Description: "determine file type",
|
||||
Generator: core.FileGenerator(),
|
||||
Generator: spec.FileGenerator(),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
package view
|
||||
|
||||
import (
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "glow",
|
||||
Description: "Render markdown on the CLI, with pizzazz!",
|
||||
Subcommands: []core.Subcommand{
|
||||
Subcommands: []spec.Subcommand{
|
||||
{Name: "config", Description: "Edit the glow config file"},
|
||||
{Name: "help", Description: "Help about any command"},
|
||||
{Name: "stash", Description: "Manage your stash of markdown files"},
|
||||
},
|
||||
Options: []core.Option{
|
||||
Options: []spec.Option{
|
||||
{Name: "-a", Description: "Show system files and directories (TUI-mode only)"},
|
||||
{Name: "--config", Description: "Config file"},
|
||||
{Name: "-h", Description: "Help for glow"},
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
package view
|
||||
|
||||
import (
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "head",
|
||||
Description: "output first lines of file",
|
||||
Generator: core.FileGenerator(),
|
||||
Options: []core.Option{
|
||||
Generator: spec.FileGenerator(),
|
||||
Options: []spec.Option{
|
||||
{Name: "-n", Description: "number of lines"},
|
||||
},
|
||||
})
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
package view
|
||||
|
||||
import (
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "idea",
|
||||
Description: "IntelliJ IDEA CLI",
|
||||
Subcommands: []core.Subcommand{
|
||||
Subcommands: []spec.Subcommand{
|
||||
{Name: "diff", Description: "Open the diff viewer to see the differences between two specified files"},
|
||||
{Name: "merge", Description: "Open the Merge dialog to merge the specified files"},
|
||||
{Name: "format", Description: "Apply code style formatting to the specified files"},
|
||||
{Name: "inspect", Description: "Perform code inspection on the specified project"},
|
||||
},
|
||||
Options: []core.Option{
|
||||
Options: []spec.Option{
|
||||
{Name: "-h", Description: "Show help for format command"},
|
||||
{Name: "-m", Description: "Process specified directories recursively"},
|
||||
{Name: "-s", Description: "Specify the code style settings file to use for formatting"},
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package view
|
||||
|
||||
import (
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "less",
|
||||
Description: "view file contents (scrollable)",
|
||||
Generator: core.FileGenerator(),
|
||||
Generator: spec.FileGenerator(),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package view
|
||||
|
||||
import (
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "lvim",
|
||||
Description: "Hyperextensible Vim-based text editor",
|
||||
Options: []core.Option{
|
||||
Options: []spec.Option{
|
||||
{Name: "--cmd", Description: "Execute <cmd> before any config"},
|
||||
{Name: "-c", Description: "Execute <cmd> after config and first file"},
|
||||
{Name: "-b", Description: "Binary mode"},
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
package view
|
||||
|
||||
import (
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "micro",
|
||||
Description: "True/false",
|
||||
Subcommands: []core.Subcommand{
|
||||
Subcommands: []spec.Subcommand{
|
||||
{Name: "remove", Description: "Remove plugin(s)"},
|
||||
{Name: "update", Description: "Update plugin(s) (if no argument is given, updates all plugins)"},
|
||||
{Name: "search", Description: "Search for a plugin"},
|
||||
{Name: "list", Description: "List installed plugins"},
|
||||
{Name: "available", Description: "List available plugins"},
|
||||
},
|
||||
Options: []core.Option{
|
||||
Options: []spec.Option{
|
||||
{Name: "--plugin", Description: "Manage plugins"},
|
||||
{Name: "--clean", Description: "Cleans the configuration directory"},
|
||||
{Name: "--config-dir", Description: "Specify a custom location for the configuration directory"},
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package view
|
||||
|
||||
import (
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "more",
|
||||
Description: "Opposite of less",
|
||||
Options: []core.Option{
|
||||
Options: []spec.Option{
|
||||
{Name: "-d", Description: "Do not pause after any line containing a ^L (form feed)"},
|
||||
{Name: "-f", Description: "Count logical lines, rather than screen lines"},
|
||||
{Name: "-p", Description: "Instead, clear the whole screen and then display the text"},
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package view
|
||||
|
||||
import (
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "nano",
|
||||
Description: "Nano",
|
||||
})
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package view
|
||||
|
||||
import (
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "nvim",
|
||||
Description: "Hyperextensible Vim-based text editor",
|
||||
Options: []core.Option{
|
||||
Options: []spec.Option{
|
||||
{Name: "--cmd", Description: "Execute <cmd> before any config"},
|
||||
{Name: "-c", Description: "Execute <cmd> after config and first file"},
|
||||
{Name: "-b", Description: "Binary mode"},
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package view
|
||||
|
||||
import (
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "rich",
|
||||
Description: "Defined by terminal, appearance may differ",
|
||||
Options: []core.Option{
|
||||
Options: []spec.Option{
|
||||
{Name: "-p", Description: "Print console markup. See https://rich.readthedocs.io/en/latest/markup.html"},
|
||||
{Name: "-u", Description: "Display a horizontal rule"},
|
||||
{Name: "-j", Description: "Display as JSON"},
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package view
|
||||
|
||||
import (
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "stat",
|
||||
Description: "display file status",
|
||||
Generator: core.FileGenerator(),
|
||||
Generator: spec.FileGenerator(),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package view
|
||||
|
||||
import (
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "subl",
|
||||
Description: "Sublime Text",
|
||||
Options: []core.Option{
|
||||
Options: []spec.Option{
|
||||
{Name: "--project", Description: "Load the given project"},
|
||||
{Name: "--command", Description: "Run the given command"},
|
||||
{Name: "-n", Description: "Open a new window"},
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
package view
|
||||
|
||||
import (
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "tail",
|
||||
Description: "output last lines of file",
|
||||
Generator: core.FileGenerator(),
|
||||
Options: []core.Option{
|
||||
Generator: spec.FileGenerator(),
|
||||
Options: []spec.Option{
|
||||
{Name: "-n", Description: "number of lines"},
|
||||
{Name: "-f", Description: "follow (live updates)"},
|
||||
},
|
||||
|
||||
+3
-3
@@ -1,14 +1,14 @@
|
||||
package view
|
||||
|
||||
import (
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "vi",
|
||||
Description: "Print help message for vi and exit",
|
||||
Options: []core.Option{
|
||||
Options: []spec.Option{
|
||||
{Name: "-h", Description: "Print help message for vi and exit"},
|
||||
},
|
||||
})
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package view
|
||||
|
||||
import (
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "vim",
|
||||
Description: "Vi IMproved, a programmer",
|
||||
Options: []core.Option{
|
||||
Options: []spec.Option{
|
||||
{Name: "-v", Description: "Vi mode (like 'vi')"},
|
||||
{Name: "-e", Description: "Ex mode (like 'ex')"},
|
||||
{Name: "-E", Description: "Improved Ex mode"},
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package view
|
||||
|
||||
import (
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "vimr",
|
||||
Description: "VimR - Neovim GUI for macOS in Swift",
|
||||
Options: []core.Option{
|
||||
Options: []spec.Option{
|
||||
{Name: "-h", Description: "Show help"},
|
||||
{Name: "--dry-run", Description: "Just print the 'open' command"},
|
||||
{Name: "--cwd", Description: "Set the working directory"},
|
||||
|
||||
+4
-4
@@ -1,15 +1,15 @@
|
||||
package view
|
||||
|
||||
import (
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "wc",
|
||||
Description: "word, line, character count",
|
||||
Generator: core.FileGenerator(),
|
||||
Options: []core.Option{
|
||||
Generator: spec.FileGenerator(),
|
||||
Options: []spec.Option{
|
||||
{Name: "-l", Description: "count lines"},
|
||||
{Name: "-w", Description: "count words"},
|
||||
{Name: "-c", Description: "count bytes"},
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package view
|
||||
|
||||
import (
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "xed",
|
||||
Description: "Xcode text editor invocation tool",
|
||||
Options: []core.Option{
|
||||
Options: []spec.Option{
|
||||
{Name: "--launch", Description: "Launches Xcode, opening a new empty unsaved file"},
|
||||
{Name: "--create", Description: "Selects the given line in the last file opened"},
|
||||
{Name: "--background", Description: "Opens Xcode without activating it; the process that invoked xed remains in front"},
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package view
|
||||
|
||||
import (
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "xxd",
|
||||
Description: "Make a hexdump or do the reverse",
|
||||
Options: []core.Option{
|
||||
Options: []spec.Option{
|
||||
{Name: "-help", Description: "Show help for xxd"},
|
||||
{Name: "-autoskip", Description: "Toggle autoskip: A single '*' replaces nul-lines. Default off"},
|
||||
{Name: "-bits", Description: "Switch to bits (binary digits) dump, rather than hexdump"},
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package view
|
||||
|
||||
import (
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "zed",
|
||||
Description: "A lightning-fast, collaborative code editor written in Rust",
|
||||
Options: []core.Option{
|
||||
Options: []spec.Option{
|
||||
{Name: "-h", Description: "Print help information"},
|
||||
{Name: "-v", Description: "Print Zed's version and the app path"},
|
||||
{Name: "-w", Description: "Wait for all of the given paths to be closed before exiting"},
|
||||
|
||||
Reference in New Issue
Block a user