Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --json flag to list-modes command #1026

Open
nikitabobko opened this issue Jan 19, 2025 · 0 comments
Open

Add --json flag to list-modes command #1026

nikitabobko opened this issue Jan 19, 2025 · 0 comments
Labels
good-first-issue Easy to fix issues. Good for newcomers

Comments

@nikitabobko
Copy link
Owner

It should work in the following way:

$ aerospace list-modes --json
[
  {
    "mode-id" : "main"
  },
  {
    "mode-id" : "service"
  }
]

$ aerospace list-modes --current --json
[
  {
    "mode-id" : "service"
  }
]

The reasoning for "redundant" wrapping objects is to make the API future-proof and consistent with other list-* commands.


E.g. in the future:

$ aerospace list-modes --json --format '%{mode-id} %{visible-mode-name}'
[
  {
    "mode-id" : "service",
    "visible-mode-name" : "Service Mode"
  }
]
@nikitabobko nikitabobko added the good-first-issue Easy to fix issues. Good for newcomers label Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good-first-issue Easy to fix issues. Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant