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

inspect.json should include request=completion for arg types #10

Open
mobileskyfi opened this issue May 31, 2024 · 0 comments
Open

inspect.json should include request=completion for arg types #10

mobileskyfi opened this issue May 31, 2024 · 0 comments

Comments

@mobileskyfi
Copy link
Contributor

mobileskyfi commented May 31, 2024

I forgot I never did this in the original generation code. But there is another possible level to "inspect" — command completion. This comes up in the "diff" tool since sometimes it the options for an argument that change, and today that's not viable in the diff.

For example, ":convert from=" - the from has value like "base64", etc, but "byte-array" is new in 7.15 (I think but diff tool don't tell me that)

/console/inspect request=completion path=convert,from
TYPE        COMPLETION  STYLE        OFFSET  PREFERENCE  SHOW  TEXT                         
completion  [           syntax-meta       0  75          no    start of command substitution
completion  (           syntax-meta       0  75          no    start of expression          
completion  $           syntax-meta       0  75          no    substitution                 
completion  "           syntax-meta       0  75          no    start of quoted string       
completion  base32      none              0  96          yes                                
completion  base64      none              0  96          yes                                
completion  byte-array  none              0  96          yes                                
completion  hex         none              0  96          yes                                
completion  raw         none              0  96          yes                                
completion  url         none              0  96          yes                                
completion  *           none              0  -1          no    id prefix                

Note

style=none & preference=yes seems to be good clues as there the possible values in a schema. (Now :convert is a bad example from a REST POV).

Today the inspect.json looks like:

"convert": {
    "_type": "cmd",
    "from": { "_type": "arg" },
    "from-scheme": { "_type": "arg", "desc": "see documentation" },
    "to": { "_type": "arg" },
    "to-scheme": { "_type": "arg", "desc": "see documentation" },
    "transform": { "_type": "arg" },
    "transform-scheme": { "_type": "arg", "desc": "see documentation" },
    "value": { "_type": "arg", "desc": "see documentation" }
  }

The idea here be that the from part have some new variables. Perhaps some new subkey like _completion:

{
  "from": {
    "_type": "arg",
    "_completion": {
      "base64": { "style": "none", "preference": 96 },
      "hex": {}
    }
  }
}
@mobileskyfi mobileskyfi changed the title inspect.json should include /console/inspect request=completion for arg types inspect.json should include request=completion for arg types May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant