forked from rosa/hakurei
cmd/app: pass user-specified arguments
An extra argument is added to pad out argv0. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
+7
-1
@@ -12,7 +12,12 @@ import (
|
||||
)
|
||||
|
||||
// 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)
|
||||
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, "run", "3")
|
||||
cmd.Args = append(cmd.Args, args...)
|
||||
|
||||
r, w, err := os.Pipe()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user