aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmd
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-10-29 04:32:43 +0900
committerOphestra <cat@gensokyo.uk>2025-10-29 04:33:13 +0900
commita0b4e47acc228e48165966d8e139277b8f6f450e (patch)
treed363a6781536ce946aa445271ca1d3df587e6031 /cmd
parenta52f7038e5a607dd0901244abb791c96deaf9c2d (diff)
internal/outcome: rename from app
This is less ambiguous, and more accurately describes the purpose of the package. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/hakurei/command.go14
-rw-r--r--cmd/hakurei/parse.go6
-rw-r--r--cmd/hakurei/print.go6
-rw-r--r--cmd/hakurei/print_test.go2
4 files changed, 14 insertions, 14 deletions
diff --git a/cmd/hakurei/command.go b/cmd/hakurei/command.go
index 968bb561..f8173e60 100644
--- a/cmd/hakurei/command.go
+++ b/cmd/hakurei/command.go
@@ -18,9 +18,9 @@ import (
"hakurei.app/container/fhs"
"hakurei.app/hst"
"hakurei.app/internal"
- "hakurei.app/internal/app"
- "hakurei.app/internal/app/state"
"hakurei.app/internal/env"
+ "hakurei.app/internal/outcome"
+ "hakurei.app/internal/state"
"hakurei.app/message"
"hakurei.app/system/dbus"
)
@@ -51,7 +51,7 @@ func buildCommand(ctx context.Context, msg message.Msg, early *earlyHardeningErr
Flag(&flagVerbose, "v", command.BoolFlag(false), "Increase log verbosity").
Flag(&flagJSON, "json", command.BoolFlag(false), "Serialise output in JSON when applicable")
- c.Command("shim", command.UsageInternal, func([]string) error { app.Shim(msg); return errSuccess })
+ c.Command("shim", command.UsageInternal, func([]string) error { outcome.Shim(msg); return errSuccess })
c.Command("app", "Load and start container from configuration file", func(args []string) error {
if len(args) < 1 {
@@ -64,7 +64,7 @@ func buildCommand(ctx context.Context, msg message.Msg, early *earlyHardeningErr
config.Container.Args = append(config.Container.Args, args[1:]...)
}
- app.Main(ctx, msg, config)
+ outcome.Main(ctx, msg, config)
panic("unreachable")
})
@@ -96,7 +96,7 @@ func buildCommand(ctx context.Context, msg message.Msg, early *earlyHardeningErr
passwd *user.User
passwdOnce sync.Once
passwdFunc = func() {
- us := strconv.Itoa(app.HsuUid(new(app.Hsu).MustID(msg), flagIdentity))
+ us := strconv.Itoa(outcome.HsuUid(new(outcome.Hsu).MustID(msg), flagIdentity))
if u, err := user.LookupId(us); err != nil {
msg.Verbosef("cannot look up uid %s", us)
passwd = &user.User{
@@ -258,7 +258,7 @@ func buildCommand(ctx context.Context, msg message.Msg, early *earlyHardeningErr
}
}
- app.Main(ctx, msg, config)
+ outcome.Main(ctx, msg, config)
panic("unreachable")
}).
Flag(&flagDBusConfigSession, "dbus-config", command.StringFlag("builtin"),
@@ -321,7 +321,7 @@ func buildCommand(ctx context.Context, msg message.Msg, early *earlyHardeningErr
var flagShort bool
c.NewCommand("ps", "List active instances", func(args []string) error {
var sc hst.Paths
- env.CopyPaths().Copy(&sc, new(app.Hsu).MustID(nil))
+ env.CopyPaths().Copy(&sc, new(outcome.Hsu).MustID(nil))
printPs(os.Stdout, time.Now().UTC(), state.NewMulti(msg, sc.RunDirPath), flagShort, flagJSON)
return errSuccess
}).Flag(&flagShort, "short", command.BoolFlag(false), "Print instance id")
diff --git a/cmd/hakurei/parse.go b/cmd/hakurei/parse.go
index 70419751..bbb9e81c 100644
--- a/cmd/hakurei/parse.go
+++ b/cmd/hakurei/parse.go
@@ -11,9 +11,9 @@ import (
"syscall"
"hakurei.app/hst"
- "hakurei.app/internal/app"
- "hakurei.app/internal/app/state"
"hakurei.app/internal/env"
+ "hakurei.app/internal/outcome"
+ "hakurei.app/internal/state"
"hakurei.app/message"
)
@@ -84,7 +84,7 @@ func shortIdentifierString(s string) string {
func tryIdentifier(msg message.Msg, name string) (config *hst.Config, entry *hst.State) {
return tryIdentifierEntries(msg, name, func() map[hst.ID]*hst.State {
var sc hst.Paths
- env.CopyPaths().Copy(&sc, new(app.Hsu).MustID(nil))
+ env.CopyPaths().Copy(&sc, new(outcome.Hsu).MustID(nil))
s := state.NewMulti(msg, sc.RunDirPath)
if entries, err := state.Join(s); err != nil {
msg.GetLogger().Printf("cannot join store: %v", err) // not fatal
diff --git a/cmd/hakurei/print.go b/cmd/hakurei/print.go
index 0dcb59ee..ff4764ca 100644
--- a/cmd/hakurei/print.go
+++ b/cmd/hakurei/print.go
@@ -12,9 +12,9 @@ import (
"hakurei.app/hst"
"hakurei.app/internal"
- "hakurei.app/internal/app"
- "hakurei.app/internal/app/state"
"hakurei.app/internal/env"
+ "hakurei.app/internal/outcome"
+ "hakurei.app/internal/state"
"hakurei.app/message"
)
@@ -23,7 +23,7 @@ func printShowSystem(output io.Writer, short, flagJSON bool) {
t := newPrinter(output)
defer t.MustFlush()
- info := &hst.Info{Version: internal.Version(), User: new(app.Hsu).MustID(nil)}
+ info := &hst.Info{Version: internal.Version(), User: new(outcome.Hsu).MustID(nil)}
env.CopyPaths().Copy(&info.Paths, info.User)
if flagJSON {
diff --git a/cmd/hakurei/print_test.go b/cmd/hakurei/print_test.go
index 343073ab..abdcefc6 100644
--- a/cmd/hakurei/print_test.go
+++ b/cmd/hakurei/print_test.go
@@ -6,7 +6,7 @@ import (
"time"
"hakurei.app/hst"
- "hakurei.app/internal/app/state"
+ "hakurei.app/internal/state"
)
var (