@@ -47,6 +47,9 @@ func init() {
4747
4848var (
4949 simulateProjectConfig * config.ProjectConfig
50+ // simulateProjectFlag is the explicit --project name, if any; the hints must
51+ // reproduce it or a re-open resolves against a different project.
52+ simulateProjectFlag string
5053)
5154
5255const (
@@ -68,6 +71,7 @@ var simulateCommand = &cli.Command{
6871 return nil , err
6972 }
7073 simulateProjectConfig = pc
74+ simulateProjectFlag = cmd .String ("project" )
7175 return nil , nil
7276 },
7377 Action : runSimulate ,
@@ -582,8 +586,9 @@ func dashboardBaseURL() string {
582586}
583587
584588// viewCommandHint returns the command to re-open a simulation run, carrying
585- // over --server-url when the run lives somewhere other than the default cloud
586- // API (e.g. staging), so the printed command targets the same environment.
589+ // over --project and --server-url when the run lives somewhere other than the
590+ // default project and cloud API (e.g. staging), so the printed command targets
591+ // the same project and environment.
587592// The binary name comes from argv[0] so a renamed or path-qualified lk is
588593// reproduced verbatim.
589594func viewCommandHint (runID string ) string {
@@ -592,6 +597,9 @@ func viewCommandHint(runID string) string {
592597 binary = os .Args [0 ]
593598 }
594599 hint := binary + " agent simulate --view " + runID
600+ if simulateProjectFlag != "" {
601+ hint += " --project " + simulateProjectFlag
602+ }
595603 if serverURL != cloudAPIServerURL {
596604 hint += " --server-url " + serverURL
597605 }
0 commit comments