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:
VERSE
2026-07-05 11:27:30 +07:00
committed by GitHub
parent 6b98455957
commit ebde9ba68f
536 changed files with 2241 additions and 2241 deletions
+4 -4
View File
@@ -1,19 +1,19 @@
package cc
import (
"github.com/versenilvis/iris/commands/core"
"github.com/versenilvis/iris/spec"
)
func init() {
core.Register(&core.Spec{
spec.Register(&spec.Spec{
Name: "bazel",
Description: "Bazel target",
Subcommands: []core.Subcommand{
Subcommands: []spec.Subcommand{
{Name: "run", Description: "Runs the specified target"},
{Name: "test", Description: "Builds and runs the specified test targets"},
{Name: "build", Description: "Builds the specified targets"},
},
Options: []core.Option{
Options: []spec.Option{
{Name: "--autodetect_server_javabase", Description: "Back to the local JDK for running the bazel server and instead exits"},
{Name: "--nobatch", Description: "Run with a server"},
{Name: "--batch_cpu_scheduling", Description: "Only on Linux; use 'batch' CPU scheduling for Bazel"},
+14 -14
View File
@@ -1,11 +1,11 @@
package cc
import (
"github.com/versenilvis/iris/commands/core"
"github.com/versenilvis/iris/spec"
)
func init() {
cOptions := []core.Option{
cOptions := []spec.Option{
{Name: "-o", Description: "output file"},
{Name: "-c", Description: "compile only (no link)"},
{Name: "-g", Description: "debug symbols"},
@@ -35,45 +35,45 @@ func init() {
{Name: "--version", Description: "print version"},
}
core.Register(&core.Spec{
spec.Register(&spec.Spec{
Name: "gcc",
Description: "GNU C compiler",
Generator: core.FileGenerator(".c", ".h"),
Generator: spec.FileGenerator(".c", ".h"),
Options: cOptions,
})
core.Register(&core.Spec{
spec.Register(&spec.Spec{
Name: "g++",
Description: "GNU C++ compiler",
Generator: core.FileGenerator(".cpp", ".cc", ".cxx", ".h", ".hpp"),
Generator: spec.FileGenerator(".cpp", ".cc", ".cxx", ".h", ".hpp"),
Options: cOptions,
})
core.Register(&core.Spec{
spec.Register(&spec.Spec{
Name: "cc",
Description: "C compiler (alias)",
Generator: core.FileGenerator(".c", ".h"),
Generator: spec.FileGenerator(".c", ".h"),
Options: cOptions,
})
core.Register(&core.Spec{
spec.Register(&spec.Spec{
Name: "c++",
Description: "C++ compiler (alias)",
Generator: core.FileGenerator(".cpp", ".cc", ".cxx", ".h", ".hpp"),
Generator: spec.FileGenerator(".cpp", ".cc", ".cxx", ".h", ".hpp"),
Options: cOptions,
})
core.Register(&core.Spec{
spec.Register(&spec.Spec{
Name: "clang",
Description: "LLVM C compiler",
Generator: core.FileGenerator(".c", ".h"),
Generator: spec.FileGenerator(".c", ".h"),
Options: cOptions,
})
core.Register(&core.Spec{
spec.Register(&spec.Spec{
Name: "clang++",
Description: "LLVM C++ compiler",
Generator: core.FileGenerator(".cpp", ".cc", ".cxx", ".h", ".hpp"),
Generator: spec.FileGenerator(".cpp", ".cc", ".cxx", ".h", ".hpp"),
Options: cOptions,
})
}
+4 -4
View File
@@ -1,14 +1,14 @@
package cc
import (
"github.com/versenilvis/iris/commands/core"
"github.com/versenilvis/iris/spec"
)
func init() {
core.Register(&core.Spec{
spec.Register(&spec.Spec{
Name: "cmake",
Description: "Command-line interface of the cross-platform buildsystem generator CMake",
Subcommands: []core.Subcommand{
Subcommands: []spec.Subcommand{
{Name: "permissions", Description: "Format: <u=rwx,g=rx,o=rx>"},
{Name: "cat", Description: "Concatenate files and print on the standard output"},
{Name: "chdir", Description: "Change the current working directory and run a command"},
@@ -37,7 +37,7 @@ func init() {
{Name: "time", Description: "Run command and display elapsed time"},
{Name: "true", Description: "Do nothing, with an exit code of 0"},
},
Options: []core.Option{
Options: []spec.Option{
{Name: "--build", Description: "Use a build preset to specify build options"},
{Name: "--list-presets", Description: "For multi-configuration tools, choose configuration <cfg>"},
{Name: "--clean-first", Description: "Build target clean first, then build"},
+4 -4
View File
@@ -1,14 +1,14 @@
package cc
import (
"github.com/versenilvis/iris/commands/core"
"github.com/versenilvis/iris/spec"
)
func init() {
core.Register(&core.Spec{
spec.Register(&spec.Spec{
Name: "premake",
Description: "The premake5.lua file",
Subcommands: []core.Subcommand{
Subcommands: []spec.Subcommand{
{Name: "clean", Description: "Remove all binaries and generated files"},
{Name: "vs2022", Description: "Generate Visual Studio 2022 project files"},
{Name: "vs2019", Description: "Generate Visual Studio 2019 project files"},
@@ -24,7 +24,7 @@ func init() {
{Name: "xcode4", Description: "Generate Apple Xcode 4 project files"},
{Name: "codelite", Description: "Generate CodeLite project files"},
},
Options: []core.Option{
Options: []spec.Option{
{Name: "--file", Description: "The premake5.lua file"},
{Name: "--debugger", Description: "Start MobDebug remote debugger. Works with ZeroBrane Studio"},
{Name: "--fatal", Description: "Treat warnings from project scripts as errors"},
+4 -4
View File
@@ -1,14 +1,14 @@
package cc
import (
"github.com/versenilvis/iris/commands/core"
"github.com/versenilvis/iris/spec"
)
func init() {
core.Register(&core.Spec{
spec.Register(&spec.Spec{
Name: "swift",
Description: "Show help information",
Subcommands: []core.Subcommand{
Subcommands: []spec.Subcommand{
{Name: "build", Description: "Build sources into binary products"},
{Name: "target", Description: "The name of the target to build"},
{Name: "product", Description: "The name of the product to build"},
@@ -60,7 +60,7 @@ func init() {
{Name: "compute-checksum", Description: "Compute the checksum for a binary artifact"},
{Name: "archive-source", Description: "Create a source archive for the package"},
},
Options: []core.Option{
Options: []spec.Option{
{Name: "--help", Description: "Show help information"},
{Name: "--version", Description: "Show the version"},
{Name: "-access-notes-path", Description: "Specify YAML file to override attributes on Swift declarations in this module"},
+4 -4
View File
@@ -1,14 +1,14 @@
package cc
import (
"github.com/versenilvis/iris/commands/core"
"github.com/versenilvis/iris/spec"
)
func init() {
core.Register(&core.Spec{
spec.Register(&spec.Spec{
Name: "typst",
Description: "The Typst compiler",
Subcommands: []core.Subcommand{
Subcommands: []spec.Subcommand{
{Name: "compile", Description: "Compiles an input file into a supported output format"},
{Name: "input", Description: "Path to input Typst file"},
{Name: "output", Description: "Path to output file (PDF, PNG, or SVG)"},
@@ -20,7 +20,7 @@ func init() {
{Name: "version", Description: "Which version to update to (defaults to latest)"},
{Name: "help", Description: "Print this message or the help of the given subcommand(s)"},
},
Options: []core.Option{
Options: []spec.Option{
{Name: "--root", Description: "Configures the project root (for absolute paths)"},
{Name: "--font-path", Description: "Adds additional directories to search for fonts"},
{Name: "--diagnostic-format", Description: "The format to emit diagnostics in"},
+3 -3
View File
@@ -1,14 +1,14 @@
package cc
import (
"github.com/versenilvis/iris/commands/core"
"github.com/versenilvis/iris/spec"
)
func init() {
core.Register(&core.Spec{
spec.Register(&spec.Spec{
Name: "xcode-select",
Description: "Active developer directory for Xcode tools",
Options: []core.Option{
Options: []spec.Option{
{Name: "-h", Description: "Help message"},
{Name: "-p", Description: "Display path to active developer directory"},
{Name: "-s", Description: "Set path to active developer directory"},
+3 -3
View File
@@ -1,14 +1,14 @@
package cc
import (
"github.com/versenilvis/iris/commands/core"
"github.com/versenilvis/iris/spec"
)
func init() {
core.Register(&core.Spec{
spec.Register(&spec.Spec{
Name: "xcodebuild",
Description: "Build Xcode projects",
Options: []core.Option{
Options: []spec.Option{
{Name: "-usage", Description: "Print brief usage"},
{Name: "-help", Description: "Print complete usage"},
{Name: "-verbose", Description: "Provide additional status output"},
+3 -3
View File
@@ -1,14 +1,14 @@
package cc
import (
"github.com/versenilvis/iris/commands/core"
"github.com/versenilvis/iris/spec"
)
func init() {
core.Register(&core.Spec{
spec.Register(&spec.Spec{
Name: "xcodeproj",
Description: "Xcodeproj lets you create and modify Xcode projects",
Options: []core.Option{
Options: []spec.Option{
{Name: "--ignore", Description: "A key to ignore in the comparison. Can be specified multiple times"},
{Name: "--format", Description: "YAML output format"},
{Name: "--group-option", Description: "Shows the difference between two targets"},
+4 -4
View File
@@ -1,17 +1,17 @@
package cc
import (
"github.com/versenilvis/iris/commands/core"
"github.com/versenilvis/iris/spec"
)
func init() {
core.Register(&core.Spec{
spec.Register(&spec.Spec{
Name: "xcrun",
Description: "SceneKit CLI utilities",
Subcommands: []core.Subcommand{
Subcommands: []spec.Subcommand{
{Name: "scntool", Description: "SceneKit CLI utilities"},
},
Options: []core.Option{
Options: []spec.Option{
{Name: "--convert", Description: "File to convert"},
{Name: "--format", Description: "Format to convert to"},
{Name: "--output", Description: "Path to the output file"},
+4 -4
View File
@@ -1,14 +1,14 @@
package cc
import (
"github.com/versenilvis/iris/commands/core"
"github.com/versenilvis/iris/spec"
)
func init() {
core.Register(&core.Spec{
spec.Register(&spec.Spec{
Name: "zig",
Description: "Enable or disable colored message",
Subcommands: []core.Subcommand{
Subcommands: []spec.Subcommand{
{Name: "build", Description: "Build project from build.zig"},
{Name: "install", Description: "Copy build artifacts to prefix path"},
{Name: "uninstall", Description: "Remove build artifacts from prefix path"},
@@ -40,7 +40,7 @@ func init() {
{Name: "version", Description: "Print version number and exit"},
{Name: "zen", Description: "Print Zen of Zig and exit"},
},
Options: []core.Option{
Options: []spec.Option{
{Name: "--color", Description: "Enable or disable colored message"},
{Name: "--cache-dir", Description: "Override path to local Zig cache directory"},
{Name: "--global-cache-dir", Description: "Override path to global Zig cache directory"},