46 lines
1017 B
Go
46 lines
1017 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var version = "dev"
|
|
|
|
func main() {
|
|
root := &cobra.Command{
|
|
Use: "archduino",
|
|
Short: "Archduino installer and toolbox",
|
|
SilenceUsage: true,
|
|
SilenceErrors: true,
|
|
Version: version,
|
|
}
|
|
|
|
root.AddCommand(newInstallCmd())
|
|
|
|
if err := root.Execute(); err != nil {
|
|
fmt.Fprintln(os.Stderr, "error:", err)
|
|
os.Exit(1)
|
|
}
|
|
}
|
|
|
|
func newInstallCmd() *cobra.Command {
|
|
var noTUI bool
|
|
var dryRun bool
|
|
cmd := &cobra.Command{
|
|
Use: "install",
|
|
Short: "Install or reconcile the Archduino toolset",
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
|
// Foundation scaffold: real wiring lands in Task 11.
|
|
fmt.Println("archduino install (stub)")
|
|
fmt.Printf(" --no-tui=%v --dry-run=%v\n", noTUI, dryRun)
|
|
return nil
|
|
},
|
|
}
|
|
cmd.Flags().BoolVar(&noTUI, "no-tui", false, "plain-text output, no interactive UI")
|
|
cmd.Flags().BoolVar(&dryRun, "dry-run", false, "show planned actions without applying")
|
|
return cmd
|
|
}
|