diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-03-28 16:43:02 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-03-28 16:48:26 +0900 |
| commit | b1ea3b4acf85365fd76c890f8b8852b5f95be5c1 (patch) | |
| tree | 465f21c2af64100da97d8441ff54d70a0fb2158a /cmd | |
| parent | 2c254c70b8838369a48c49f55a0346a7740f1514 (diff) | |
cmd/hakurei: rename app to run
The run command was a legacy holdover from very early days and is only useful for testing and demonstration these days. This change also renames it to exec.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/hakurei/command.go | 10 | ||||
| -rw-r--r-- | cmd/hakurei/command_test.go | 10 | ||||
| -rw-r--r-- | cmd/hakurei/main.go | 12 |
3 files changed, 14 insertions, 18 deletions
diff --git a/cmd/hakurei/command.go b/cmd/hakurei/command.go index b40b6b86..6e5b446a 100644 --- a/cmd/hakurei/command.go +++ b/cmd/hakurei/command.go @@ -34,6 +34,8 @@ func optionalErrorUnwrap(err error) error { return err } +var errSuccess = errors.New("success") + func buildCommand(ctx context.Context, msg message.Msg, early *earlyHardeningErrs, out io.Writer) command.Command { var ( flagVerbose bool @@ -63,9 +65,9 @@ func buildCommand(ctx context.Context, msg message.Msg, early *earlyHardeningErr var ( flagIdentifierFile int ) - c.NewCommand("app", "Load and start container from configuration file", func(args []string) error { + c.NewCommand("run", "Load and start container from configuration file", func(args []string) error { if len(args) < 1 { - log.Fatal("app requires at least 1 argument") + log.Fatal("run requires at least 1 argument") } config := tryPath(msg, args[0]) @@ -101,7 +103,7 @@ func buildCommand(ctx context.Context, msg message.Msg, early *earlyHardeningErr flagWayland, flagX11, flagDBus, flagPipeWire, flagPulse bool ) - c.NewCommand("run", "Configure and start a permissive container", func(args []string) error { + c.NewCommand("exec", "Configure and start a permissive container", func(args []string) error { if flagIdentity < hst.IdentityStart || flagIdentity > hst.IdentityEnd { log.Fatalf("identity %d out of range", flagIdentity) } @@ -326,7 +328,7 @@ func buildCommand(ctx context.Context, msg message.Msg, early *earlyHardeningErr flagShort bool flagNoStore bool ) - c.NewCommand("show", "Show live or local app configuration", func(args []string) error { + c.NewCommand("show", "Show live or local instance configuration", func(args []string) error { switch len(args) { case 0: // system printShowSystem(os.Stdout, flagShort, flagJSON) diff --git a/cmd/hakurei/command_test.go b/cmd/hakurei/command_test.go index 67c80697..a7a5027e 100644 --- a/cmd/hakurei/command_test.go +++ b/cmd/hakurei/command_test.go @@ -23,9 +23,9 @@ func TestHelp(t *testing.T) { Usage: hakurei [-h | --help] [-v] [--json] COMMAND [OPTIONS] Commands: - app Load and start container from configuration file - run Configure and start a permissive container - show Show live or local app configuration + run Load and start container from configuration file + exec Configure and start a permissive container + show Show live or local instance configuration ps List active instances version Display version information license Show full license text @@ -35,8 +35,8 @@ Commands: `, }, { - "run", []string{"run", "-h"}, ` -Usage: hakurei run [-h | --help] [--dbus-config <value>] [--dbus-system <value>] [--mpris] [--dbus-log] [--id <value>] [-a <int>] [-g <value>] [-d <value>] [-u <value>] [--policy <value>] [--priority <int>] [--private-runtime] [--private-tmpdir] [--wayland] [-X] [--dbus] [--pipewire] [--pulse] COMMAND [OPTIONS] + "exec", []string{"exec", "-h"}, ` +Usage: hakurei exec [-h | --help] [--dbus-config <value>] [--dbus-system <value>] [--mpris] [--dbus-log] [--id <value>] [-a <int>] [-g <value>] [-d <value>] [-u <value>] [--policy <value>] [--priority <int>] [--private-runtime] [--private-tmpdir] [--wayland] [-X] [--dbus] [--pipewire] [--pulse] COMMAND [OPTIONS] Flags: -X Enable direct connection to X11 diff --git a/cmd/hakurei/main.go b/cmd/hakurei/main.go index b7722bc3..a5b14d9c 100644 --- a/cmd/hakurei/main.go +++ b/cmd/hakurei/main.go @@ -1,8 +1,5 @@ package main -// this works around go:embed '..' limitation -//go:generate cp ../../LICENSE . - import ( "context" _ "embed" @@ -17,12 +14,9 @@ import ( "hakurei.app/message" ) -var ( - errSuccess = errors.New("success") - - //go:embed LICENSE - license string -) +//go:generate cp ../../LICENSE . +//go:embed LICENSE +var license string // earlyHardeningErrs are errors collected while setting up early hardening feature. type earlyHardeningErrs struct{ yamaLSM, dumpable error } |
