cmd/app: pass user-specified arguments
Test / Create distribution (push) Successful in 50s
Test / Sandbox (push) Successful in 2m52s
Test / ShareFS (push) Successful in 3m48s
Test / Sandbox (race detector) (push) Successful in 5m20s
Test / Hakurei (race detector) (push) Successful in 6m37s
Test / Hakurei (push) Successful in 2m40s
Test / Flake checks (push) Successful in 1m26s
Test / Create distribution (push) Successful in 50s
Test / Sandbox (push) Successful in 2m52s
Test / ShareFS (push) Successful in 3m48s
Test / Sandbox (race detector) (push) Successful in 5m20s
Test / Hakurei (race detector) (push) Successful in 6m37s
Test / Hakurei (push) Successful in 2m40s
Test / Flake checks (push) Successful in 1m26s
An extra argument is added to pad out argv0. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
+1
-1
@@ -112,7 +112,7 @@ func parse(id string, base *check.Absolute, r io.Reader) (*hst.Config, error) {
|
|||||||
if err := scanOnce(); err != nil {
|
if err := scanOnce(); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
c.Container.Args = append(c.Container.Args, s.Text())
|
c.Container.Args = append(c.Container.Args, s.Text(), "")
|
||||||
|
|
||||||
var flagGPU, flagSystemBus bool
|
var flagGPU, flagSystemBus bool
|
||||||
flags := map[string]*bool{
|
flags := map[string]*bool{
|
||||||
|
|||||||
@@ -120,6 +120,7 @@ talk com.canonical.Unity
|
|||||||
Args: []string{
|
Args: []string{
|
||||||
"zsh", "-ic",
|
"zsh", "-ic",
|
||||||
"exec Discord --ozone-platform-hint=wayland",
|
"exec Discord --ozone-platform-hint=wayland",
|
||||||
|
"",
|
||||||
},
|
},
|
||||||
|
|
||||||
Flags: hst.FCoverRun | hst.FUserns | hst.FHostNet | hst.FMapRealUID |
|
Flags: hst.FCoverRun | hst.FUserns | hst.FHostNet | hst.FMapRealUID |
|
||||||
|
|||||||
+2
-2
@@ -148,7 +148,7 @@ func main() {
|
|||||||
c.NewCommand(
|
c.NewCommand(
|
||||||
"run", "Start the named application",
|
"run", "Start the named application",
|
||||||
func(args []string) error {
|
func(args []string) error {
|
||||||
if len(args) != 1 {
|
if len(args) < 1 {
|
||||||
dents, err := os.ReadDir(base.Append("app").String())
|
dents, err := os.ReadDir(base.Append("app").String())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -197,7 +197,7 @@ func main() {
|
|||||||
config.Container.Args[2] = flagCommand
|
config.Container.Args[2] = flagCommand
|
||||||
}
|
}
|
||||||
|
|
||||||
return run(ctx, msg, config)
|
return run(ctx, msg, config, args[1:]...)
|
||||||
},
|
},
|
||||||
).
|
).
|
||||||
Flag(
|
Flag(
|
||||||
|
|||||||
+7
-1
@@ -12,7 +12,12 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// run starts a container via cmd/hakurei and returns after it terminates.
|
// run starts a container via cmd/hakurei and returns after it terminates.
|
||||||
func run(ctx context.Context, msg message.Msg, config *hst.Config) error {
|
func run(
|
||||||
|
ctx context.Context,
|
||||||
|
msg message.Msg,
|
||||||
|
config *hst.Config,
|
||||||
|
args ...string,
|
||||||
|
) error {
|
||||||
c, cancel := context.WithCancel(ctx)
|
c, cancel := context.WithCancel(ctx)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
@@ -25,6 +30,7 @@ func run(ctx context.Context, msg message.Msg, config *hst.Config) error {
|
|||||||
cmd.Args = append(cmd.Args, "-v")
|
cmd.Args = append(cmd.Args, "-v")
|
||||||
}
|
}
|
||||||
cmd.Args = append(cmd.Args, "run", "3")
|
cmd.Args = append(cmd.Args, "run", "3")
|
||||||
|
cmd.Args = append(cmd.Args, args...)
|
||||||
|
|
||||||
r, w, err := os.Pipe()
|
r, w, err := os.Pipe()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user