Skip to content

[Bug]: step context list should print an error to stderr and exit 1 if there are no contexts present #879

Open

Description

@jdoss

Steps to Reproduce

I am looking for a way to tell if STEPPATH is using contexts or not.

$ export STEPPATH=/tmp/tmpsteppath
$ step ca bootstrap --ca-url https://my.cool.ca.smallstep.com --fingerprint myfingerprint 
$ step context list
$ echo $?
0

If STEPPATH is not using a context step context list should output that there are no contexts present to stderr and exit 1

Your Environment

Fedora Linux 37

$ step version
Smallstep CLI/0.23.4 (linux/amd64)

Expected Behavior

$ export STEPPATH=/tmp/tmpsteppath
$ step ca bootstrap --ca-url https://my.cool.ca.smallstep.com --fingerprint myfingerprint 
$ step context list
Error: There are no contexts to list
$ echo $?
1

Actual Behavior

$ export STEPPATH=/tmp/tmpsteppath
$ step ca bootstrap --ca-url https://my.cool.ca.smallstep.com --fingerprint myfingerprint 
$ step context list
$ echo $?
0

Additional Context

No response

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

Activity

  1. added this to the v0.26.1 milestone on Mar 29, 2024
  2. modified the milestones: v0.26.1, v0.26.2 on Apr 25, 2024
  3. modified the milestones: v0.26.2, v0.26.3 on Jun 17, 2024
  4. modified the milestones: v0.27.0, v0.27.2 on Jul 15, 2024
  5. modified the milestones: v0.27.2, v0.27.3 on Jul 23, 2024
  6. modified the milestones: v0.27.4, v0.27.5 on Sep 16, 2024
  7. modified the milestones: v0.27.5, v0.27.6 on Oct 22, 2024
  8. modified the milestones: v0.27.6, v0.28.1 on Oct 30, 2024
  9. modified the milestones: v0.28.1, v0.28.3 on Nov 21, 2024
  10. modified the milestones: v0.28.3, v0.28.4 on Feb 20, 2025
  11. modified the milestones: v0.28.5, v0.28.6 on Mar 5, 2025
  12. modified the milestones: v0.28.6, v0.28.7 on Mar 18, 2025
  13. modified the milestones: v0.28.7, v0.28.8 on Jul 28, 2025
  14. modified the milestones: v0.29.0, v0.29.1 on Dec 3, 2025
  15. removed this from the v0.30.0 milestone on Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugneeds triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions