最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

c# - Implement autocomplete in autorest with directives - Stack Overflow

programmeradmin3浏览0评论

I’m using Autorest to generate PowerShell cmdlets and I want to implement argument completion for a parameter dynamically using another cmdlet (e.g., Get-BsnOsmCliNSinstance).

I’ve read about using directives in Autorest and tried setting a completer like this in my configuration.yaml:

This is my script :

input-file: osm-openapi.yaml


directive:
  - where:
      verb: Get
      subject: BsnOsmCliNsi
      parameter-name: NetsliceInstanceId
    set:
      completer:
        name: NetsliceInstanceId Completer
        description: Dynamically retrieves NetsliceInstanceIds from Get-BsnOsmCliNSinstance for tab completion.
        script: "(Get-BsnOsmCliNSinstance | ForEach-Object { $_.Id })"

or

input-file: osm-openapi.yaml

directive:
  - where:
      verb: Get
      subject: BsnOsmCliNsi
      parameter-name: NetsliceInstanceId
    set:
      completer:
        name: NetsliceInstanceId Completer
        description: Dynamically retrieves NetsliceInstanceIds for tab completion.
        script: "'westus2', 'centralus', 'global'"

My Expectation : Get-BsnOsmCliNsi -NetsliceInstanceId

发布评论

评论列表(0)

  1. 暂无评论