(s *Shell, cmd *Cmd, args []string)
| 660 | } |
| 661 | |
| 662 | func newContext(s *Shell, cmd *Cmd, args []string) *Context { |
| 663 | if cmd == nil { |
| 664 | cmd = &Cmd{} |
| 665 | } |
| 666 | return &Context{ |
| 667 | Actions: s.Actions, |
| 668 | progressBar: copyShellProgressBar(s), |
| 669 | Args: args, |
| 670 | RawArgs: s.rawArgs, |
| 671 | Cmd: *cmd, |
| 672 | contextValues: func() contextValues { |
| 673 | values := contextValues{} |
| 674 | for k := range s.contextValues { |
| 675 | values[k] = s.contextValues[k] |
| 676 | } |
| 677 | return values |
| 678 | }(), |
| 679 | } |
| 680 | } |
| 681 | |
| 682 | func copyShellProgressBar(s *Shell) ProgressBar { |
| 683 | sp := s.progressBar.(*progressBarImpl) |
no test coverage detected