root

package
v0.8.0-a.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CompileCmd = &cobra.Command{
		Use:   "compile",
		Short: "Generate a factory binary's main.go from factory source",
		RunE: func(cmd *cobra.Command, args []string) error {
			return runCompile(cmd, compileCfg)
		},
	}
)
View Source
var DepsCmd = &cobra.Command{
	Use:   "deps",
	Short: "Manage a factory's dependencies",
	Long: `Manage dependency floors in manifest.ub and selected versions in lock.ub.

A factory or UB library writes imports in .ub source. The manifest records
its direct dependency floors, and the lock records the versions and source
hashes the compiler should use.`,
}

DepsCmd is the parent for the dependency-management subcommands.

View Source
var (
	FmtCmd = &cobra.Command{
		Use:   "fmt [paths...]",
		Short: "Format .ub source files",
		Long: `Reformat one or more .ub files in canonical form.

With no path arguments, fmt reads from stdin and writes the
formatted bytes to stdout. With one or more paths, each file is
formatted in turn; directory arguments are walked recursively for
*.ub files.

Flags:
  -w / --write   overwrite each file in place instead of writing to
                 stdout.
  -l / --list    print the names of files whose formatted output
                 differs from their current contents; no other output.

Examples:
  unobin fmt factory.ub
  unobin fmt -w factory.ub libraries/
  unobin fmt -l .
`,
		RunE: func(cmd *cobra.Command, args []string) error {
			return runFmt(cmd, args, fmtCfg)
		},
	}
)
View Source
var GenerateCmd = &cobra.Command{
	Use:   "generate",
	Short: "Generate code and scaffold libraries",
}
View Source
var (
	PrintGraphCmd = &cobra.Command{
		Use:   "print-graph",
		Short: "Print a factory's dependency graph without compiling it",
		Long: `Print a factory's dependency graph from its source.

Imports are resolved in memory; composite call sites are expanded
into their internal sub-nodes the same way the generated binary's
print-graph subcommand does. The output is intended to match what
the compiled binary would emit.

Examples:
  unobin print-graph
  unobin print-graph -p factory.ub --format dot | dot -Tsvg > graph.svg`,

		RunE: func(cmd *cobra.Command, args []string) error {
			return runPrintGraph(cmd, printGraphCfg)
		},
	}
)
View Source
var Version = "dev"

Version is the build time version string. Set via -ldflags.

View Source
var (
	VersionCmd = &cobra.Command{
		Use:   "version",
		Short: "Print the unobin version",
		Run: func(cmd *cobra.Command, args []string) {
			cmd.Println(cliVersion())
		},
	}
)

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL