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

traverse: collect context information about args #922

Open
rsteube opened this issue Oct 1, 2023 · 1 comment · May be fixed by #923
Open

traverse: collect context information about args #922

rsteube opened this issue Oct 1, 2023 · 1 comment · May be fixed by #923
Labels
enhancement New feature or request

Comments

@rsteube
Copy link
Member

rsteube commented Oct 1, 2023

Request

Since traverse already iterates over the arguments and identifies them this should be stored and optionally returned.

Proposed solution

Provide an array of context information:

  • value of the arg
  • name of flag/subcommand
  • desctiption of flag/subcommand
  • type (flag type | argument type | command)
  • optarg (embed the same if it is an optarg)

Anything else?

gh issue --repo rsteube/carapace list --label enhancement --state open --web

Could be visualized like:

gh # GitHub CLI
issue # Manage issues
  --repo rsteube/carapace # Select another repository using the `[HOST/]OWNER/REPO` format
list #  List issues in a repository
  --label enhancement # Filter by label
  --state open # Filter by state: {open|closed|all}
  --web # List issues in the web browser
@rsteube rsteube added the enhancement New feature or request label Oct 1, 2023
@rsteube rsteube linked a pull request Oct 1, 2023 that will close this issue
@rsteube
Copy link
Member Author

rsteube commented Oct 1, 2023

Flag chains could pose an issue. Might be more helpful to destructure the arguments (and even prefer the longhand for flags?).

ls -lha /tmp
exa # a modern replacement for ls
  -l # display extended file metadata as a table
  -h # add a header row to each column
  -a # show hidden and 'dot' files
  /tmp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant