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 runner
|
||||
|
||||
import (
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "ant",
|
||||
Description: "Apache Ant - Java library and command-line build tool",
|
||||
Options: []core.Option{
|
||||
Options: []spec.Option{
|
||||
{Name: "--help", Description: "Show help for ant"},
|
||||
{Name: "--noconfig", Description: "Enable use of jikes by default, unless set explicitly in configuration files"},
|
||||
{Name: "--execdebug", Description: "Print ant exec line generated by this launch script"},
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package runner
|
||||
|
||||
import (
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "composer",
|
||||
Description: "Composer Command",
|
||||
Options: []core.Option{
|
||||
Options: []spec.Option{
|
||||
{Name: "-h", Description: "Display this help message"},
|
||||
{Name: "-q", Description: "Do not output any message"},
|
||||
{Name: "-V", Description: "Display this application version"},
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package runner
|
||||
|
||||
import (
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "dbt",
|
||||
Description: "CLI for dbt - Data Build Tool",
|
||||
Subcommands: []core.Subcommand{
|
||||
Subcommands: []spec.Subcommand{
|
||||
{Name: "build", Description: "Run models, test tests, snapshot snapshots, and seed seeds"},
|
||||
{Name: "directory", Description: "Directory containing profiles.yml"},
|
||||
{Name: "name", Description: "Name of profile to use when running dbt project"},
|
||||
@@ -45,7 +45,7 @@ func init() {
|
||||
{Name: "ls", Description: "Lists resources defined in a dbt project"},
|
||||
{Name: "parse", Description: "Parse dbt project and write detailed timing information"},
|
||||
},
|
||||
Options: []core.Option{
|
||||
Options: []spec.Option{
|
||||
{Name: "--full-refresh", Description: "Treat incremental models as table models"},
|
||||
{Name: "-x", Description: "Exit immediately if a single model fails to build"},
|
||||
{Name: "--profiles-dir", Description: "Set the profiles directory"},
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package runner
|
||||
|
||||
import (
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "drush",
|
||||
Description: "Drush is a command line shell and Unix scripting interface for Drupal",
|
||||
})
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package runner
|
||||
|
||||
import (
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "elixir",
|
||||
Description: "Elixir Language",
|
||||
Options: []core.Option{
|
||||
Options: []spec.Option{
|
||||
{Name: "-e", Description: "Evaluates the given command"},
|
||||
{Name: "-h", Description: "Prints this message and exits"},
|
||||
{Name: "-r", Description: "Requires the given files/patterns"},
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package runner
|
||||
|
||||
import (
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "gem",
|
||||
Description: "Use HTTP proxy for remote operations",
|
||||
Subcommands: []core.Subcommand{
|
||||
Subcommands: []spec.Subcommand{
|
||||
{Name: "help", Description: "Help about any command"},
|
||||
{Name: "install", Description: "Install a gem into the local repository"},
|
||||
{Name: "PLATFORM", Description: "The platform of gem"},
|
||||
@@ -60,7 +60,7 @@ func init() {
|
||||
{Name: "GEM", Description: "Name of gem"},
|
||||
{Name: "uninstall", Description: "Uninstall gems from the local repository"},
|
||||
},
|
||||
Options: []core.Option{
|
||||
Options: []spec.Option{
|
||||
{Name: "-p", Description: "Use HTTP proxy for remote operations"},
|
||||
{Name: "--no-http-proxy", Description: "Do not use HTTP proxy for remote operations"},
|
||||
{Name: "-l", Description: "Restrict operations to the LOCAL domain"},
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package runner
|
||||
|
||||
import (
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "hexo",
|
||||
Description: "Draft for",
|
||||
Subcommands: []core.Subcommand{
|
||||
Subcommands: []spec.Subcommand{
|
||||
{Name: "config", Description: "Get or set configurations"},
|
||||
{Name: "help", Description: "Displays a help for each command"},
|
||||
{Name: "command", Description: "The command to display help for"},
|
||||
@@ -35,7 +35,7 @@ func init() {
|
||||
{Name: "list", Description: "List all routes"},
|
||||
{Name: "version", Description: "Display version information"},
|
||||
},
|
||||
Options: []core.Option{
|
||||
Options: []spec.Option{
|
||||
{Name: "--no-clone", Description: "Copy files instead of cloning from GitHub"},
|
||||
{Name: "--no-install", Description: "Skip npm install"},
|
||||
{Name: "-p", Description: "Post path. Customize the path of the post"},
|
||||
|
||||
@@ -6,15 +6,15 @@ import (
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "just",
|
||||
Description: "command runner",
|
||||
MaxArgs: 1,
|
||||
Generator: func(tokens []string, prefix string, partial string) []core.Suggestion {
|
||||
Generator: func(tokens []string, prefix string, partial string) []spec.Suggestion {
|
||||
file, err := os.Open("justfile")
|
||||
if err != nil {
|
||||
// try uppercase
|
||||
@@ -25,7 +25,7 @@ func init() {
|
||||
}
|
||||
defer func() { _ = file.Close() }()
|
||||
|
||||
var suggestions []core.Suggestion
|
||||
var suggestions []spec.Suggestion
|
||||
seen := make(map[string]bool)
|
||||
scanner := bufio.NewScanner(file)
|
||||
// matching recipes like `build:`
|
||||
@@ -61,7 +61,7 @@ func init() {
|
||||
desc = lastComment
|
||||
}
|
||||
|
||||
suggestions = append(suggestions, core.Suggestion{
|
||||
suggestions = append(suggestions, spec.Suggestion{
|
||||
Cmd: cmd,
|
||||
Desc: desc,
|
||||
})
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
package runner
|
||||
|
||||
import (
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "laravel",
|
||||
Description: "The output format (txt, xml, json, or md)",
|
||||
Subcommands: []core.Subcommand{
|
||||
Subcommands: []spec.Subcommand{
|
||||
{Name: "new", Description: "Create a new Laravel application"},
|
||||
},
|
||||
Options: []core.Option{
|
||||
Options: []spec.Option{
|
||||
{Name: "--format", Description: "The output format (txt, xml, json, or md)"},
|
||||
{Name: "--raw", Description: "To output raw command list"},
|
||||
{Name: "--dev", Description: "Initialize a Git repository"},
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package runner
|
||||
|
||||
import (
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "magento",
|
||||
Description: "Open-source E-commerce",
|
||||
})
|
||||
|
||||
@@ -5,14 +5,14 @@ import (
|
||||
"os"
|
||||
"regexp"
|
||||
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "make",
|
||||
Description: "build automation",
|
||||
Generator: func(tokens []string, prefix string, partial string) []core.Suggestion {
|
||||
Generator: func(tokens []string, prefix string, partial string) []spec.Suggestion {
|
||||
// Read the Makefile
|
||||
file, err := os.Open("Makefile")
|
||||
if err != nil {
|
||||
@@ -21,7 +21,7 @@ func init() {
|
||||
}
|
||||
defer func() { _ = file.Close() }()
|
||||
|
||||
var suggestions []core.Suggestion
|
||||
var suggestions []spec.Suggestion
|
||||
seen := make(map[string]bool)
|
||||
scanner := bufio.NewScanner(file)
|
||||
// Matches targets like `build:`, ` run :`, etc.
|
||||
@@ -42,7 +42,7 @@ func init() {
|
||||
if prefix != "" {
|
||||
cmd = prefix + " " + target
|
||||
}
|
||||
suggestions = append(suggestions, core.Suggestion{
|
||||
suggestions = append(suggestions, spec.Suggestion{
|
||||
Cmd: cmd,
|
||||
Desc: "make target",
|
||||
})
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
package runner
|
||||
|
||||
import (
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "mix",
|
||||
Description: "Build tool for Elixir",
|
||||
Subcommands: []core.Subcommand{
|
||||
Subcommands: []spec.Subcommand{
|
||||
{Name: "new", Description: "Creates a new Elixir project at the given path"},
|
||||
{Name: "run", Description: "Starts the current application and runs code"},
|
||||
{Name: "code", Description: "String containing code to execute"},
|
||||
{Name: "file|pattern", Description: "The file|pattern to execute"},
|
||||
},
|
||||
Options: []core.Option{
|
||||
Options: []spec.Option{
|
||||
{Name: "-h", Description: "Output usage information"},
|
||||
{Name: "--app", Description: "Name the OTP application for the project"},
|
||||
{Name: "--modules", Description: "Name the modules in the generated code skeleton"},
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package runner
|
||||
|
||||
import (
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "php",
|
||||
Description: "Run the PHP interpreter",
|
||||
})
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package runner
|
||||
|
||||
import (
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "phpunit",
|
||||
Description: "Generate code coverage report in Clover XML format,",
|
||||
Options: []core.Option{
|
||||
Options: []spec.Option{
|
||||
{Name: "--coverage-clover", Description: "Generate code coverage report in Clover XML format,"},
|
||||
{Name: "--coverage-crap4j", Description: "Generate code coverage report in Crap4J XML format"},
|
||||
{Name: "--coverage-html", Description: "Generate code coverage report in HTML format"},
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package runner
|
||||
|
||||
import (
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "phpunit-watcher",
|
||||
Description: "Automatically rerun PHPUnit tests when source code changes",
|
||||
Options: []core.Option{
|
||||
Options: []spec.Option{
|
||||
{Name: "--filter", Description: "Watch a specific test"},
|
||||
},
|
||||
})
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package runner
|
||||
|
||||
import (
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "rails",
|
||||
Description: "Create a new rails application",
|
||||
Options: []core.Option{
|
||||
Options: []spec.Option{
|
||||
{Name: "-skip-namespace", Description: "Skip namespace (affects only isolated applications)"},
|
||||
{Name: "-r", Description: "Path to the Ruby binary of your choice"},
|
||||
{Name: "-m", Description: "Path to some application template (can be a filesystem path or URL)"},
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package runner
|
||||
|
||||
import (
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "rake",
|
||||
Description: "A ruby build program with capabilities similar to make",
|
||||
Options: []core.Option{
|
||||
Options: []spec.Option{
|
||||
{Name: "-n", Description: "Do a dry run without executing actions"},
|
||||
{Name: "-h", Description: "Display this help message"},
|
||||
{Name: "-I", Description: "Include LIBDIR in the search path for required modules"},
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package runner
|
||||
|
||||
import (
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "rubocop",
|
||||
Description: "Run only lint cops",
|
||||
Options: []core.Option{
|
||||
Options: []spec.Option{
|
||||
{Name: "-l", Description: "Run only lint cops"},
|
||||
{Name: "-x", Description: "Run only layout cops, with autocorrect on"},
|
||||
{Name: "--safe", Description: "Run only safe cops"},
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package runner
|
||||
|
||||
import (
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "ruby",
|
||||
Description: "Interpreted object-oriented scripting language",
|
||||
Options: []core.Option{
|
||||
Options: []spec.Option{
|
||||
{Name: "--copyright", Description: "Prints the copyright notice"},
|
||||
{Name: "--version", Description: "Prints the version of Ruby interpreter"},
|
||||
{Name: "-0", Description: "Specifies the input record separator ($/) as an octal number"},
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package runner
|
||||
|
||||
import (
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "rvm",
|
||||
Description: "Show version of rvm",
|
||||
Subcommands: []core.Subcommand{
|
||||
Subcommands: []spec.Subcommand{
|
||||
{Name: "use", Description: "Setup current shell to use a specific ruby version"},
|
||||
{Name: "reset", Description: "Remove default and current settings, exit the shell"},
|
||||
{Name: "info", Description: "Show information about the current ruby environment"},
|
||||
@@ -23,7 +23,7 @@ func init() {
|
||||
{Name: "uninstall", Description: "Uninstall one or many ruby versions, leaves their sources"},
|
||||
{Name: "remove", Description: "Remove one or many ruby versions, including their sources"},
|
||||
},
|
||||
Options: []core.Option{
|
||||
Options: []spec.Option{
|
||||
{Name: "--version", Description: "Show version of rvm"},
|
||||
{Name: "--default", Description: "When used with ruby selection, sets a default ruby for new shells"},
|
||||
{Name: "--debug", Description: "Enable debug mode"},
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package runner
|
||||
|
||||
import (
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "sidekiq",
|
||||
Description: "Background job framework for Ruby",
|
||||
Options: []core.Option{
|
||||
Options: []spec.Option{
|
||||
{Name: "--concurrency", Description: "Processor threads to use"},
|
||||
{Name: "--environment", Description: "Application environment"},
|
||||
{Name: "--tag", Description: "Process tag for procline"},
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package runner
|
||||
|
||||
import (
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "symfony",
|
||||
Description: "Symfony Binary",
|
||||
Subcommands: []core.Subcommand{
|
||||
Subcommands: []spec.Subcommand{
|
||||
{Name: "cloud:clear-cache", Description: "Clear the CLI cache"},
|
||||
{Name: "cloud:docs", Description: "Open the online documentation"},
|
||||
{Name: "cloud:multi", Description: "Execute a command on multiple projects"},
|
||||
@@ -60,7 +60,7 @@ func init() {
|
||||
{Name: "cloud:environment:url", Description: "Get the public URLs of an environment"},
|
||||
{Name: "cloud:environment:xdebug", Description: "Open a tunnel to Xdebug on the environment"},
|
||||
},
|
||||
Options: []core.Option{
|
||||
Options: []spec.Option{
|
||||
{Name: "-h", Description: "Show help"},
|
||||
{Name: "-q", Description: "Do not output any message"},
|
||||
{Name: "--no-ansi", Description: "Disable ANSI output"},
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package runner
|
||||
|
||||
import (
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "valet",
|
||||
Description: "Do not output any message",
|
||||
Subcommands: []core.Subcommand{
|
||||
Subcommands: []spec.Subcommand{
|
||||
{Name: "diagnose", Description: "Output diagnostics to aid in debugging Valet"},
|
||||
{Name: "fetch-share-url", Description: "Get the URL to the current share tunnel (for Expose or ngrok)"},
|
||||
{Name: "forget", Description: "Remove the current working (or specified) directory from Valet's list of paths"},
|
||||
@@ -46,7 +46,7 @@ func init() {
|
||||
{Name: "share-tool", Description: "Get the name of the current share tool (Expose or ngrok)"},
|
||||
{Name: "status", Description: "Output the status of Valet and its installed services and config"},
|
||||
},
|
||||
Options: []core.Option{
|
||||
Options: []spec.Option{
|
||||
{Name: "-h", Description: "Do not output any message"},
|
||||
{Name: "-V", Description: "Display this application version"},
|
||||
{Name: "--ansi", Description: "Force (or disable --no-ansi) ANSI output"},
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package runner
|
||||
|
||||
import (
|
||||
"github.com/versenilvis/iris/commands/core"
|
||||
"github.com/versenilvis/iris/spec"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.Register(&core.Spec{
|
||||
spec.Register(&spec.Spec{
|
||||
Name: "vapor",
|
||||
Description: "Vapor Toolbox (Server-side Swift web framework)",
|
||||
Subcommands: []core.Subcommand{
|
||||
Subcommands: []spec.Subcommand{
|
||||
{Name: "build", Description: "Builds an app in the console"},
|
||||
{Name: "new", Description: "Generates a new app"},
|
||||
{Name: "name", Description: "Name of project and folder"},
|
||||
@@ -21,7 +21,7 @@ func init() {
|
||||
{Name: "update", Description: "Updates Supervisor entry for current project"},
|
||||
{Name: "xcode", Description: "Opens an app in Xcode"},
|
||||
},
|
||||
Options: []core.Option{
|
||||
Options: []spec.Option{
|
||||
{Name: "--template", Description: "The URL of a Git repository to use as a template"},
|
||||
{Name: "--branch", Description: "Template repository branch to use"},
|
||||
{Name: "--output", Description: "The directory to place the new project in"},
|
||||
|
||||
Reference in New Issue
Block a user