cobra icon indicating copy to clipboard operation
cobra copied to clipboard

Always propagate root context to child command

Open pietern opened this issue 2 years ago • 5 comments
trafficstars

The context passed to the root command should propagate to its children not only on the first execution but also subsequent calls. Calling the same command multiple times is common when testing cobra applications.

pietern avatar Dec 09 '22 15:12 pietern

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Dec 09 '22 15:12 CLAassistant

Thanks @pietern. Can you first sign the CLA: https://github.com/spf13/cobra/pull/1875#issuecomment-1344437980

marckhouzam avatar Dec 09 '22 20:12 marckhouzam

The Cobra project currently lacks enough contributors to adequately respond to all PRs. This bot triages issues and PRs according to the following rules:

  • After 60d of inactivity, lifecycle/stale is applied. - After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied and the PR is closed. You can:
  • Make a comment to remove the stale label and show your support. The 60 days reset. - If a PR has lifecycle/rotten and is closed, comment and ask maintainers if they'd be interested in reopening.

github-actions[bot] avatar Feb 10 '23 00:02 github-actions[bot]

Not stale.

pietern avatar Feb 12 '23 12:02 pietern

I had a similar request: https://github.com/spf13/cobra/issues/2077 . I think they are trying to cover similar use cases.

libozh avatar Dec 27 '23 21:12 libozh