Skip to content

Commit 5a5ec6c

Browse files
authored
Merge pull request Azure#272 from kairu-ms/improve-docs-2
Add docs for subcommand generation.
2 parents fb3789f + fbd40f9 commit 5a5ec6c

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed
4.17 MB
Loading
6.18 MB
Loading

docs/pages/usage/workspace_editor.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,23 @@ When developing commands, it may be necessary to correct Swagger errors. You can
372372

373373
![reload_from_swagger](../../assets/recordings/workspace_editor/reload_from_swagger.gif)
374374

375+
## Subcommand generation
376+
377+
For some compound arguments, we support [shorthand syntax](https://github.com/Azure/azure-cli/blob/dev/doc/shorthand_syntax.md) to pass values.
378+
For some cases, it will be much convenience for users by using subcommands. You can use the following way to create subcommands.
379+
380+
![generate_subcommands](../../assets/recordings/workspace_editor/generate_subcommands.gif)
381+
382+
> **Warning**
383+
>
384+
> The subcommands generation relies on **Generic(Get&Put)** update. So please make sure the __update__ command of the resource is Generic(Get&Put) update.
385+
386+
When the argument used of subcommands generation is `array` type, the subcommand will have `--xxxxx-index` argument to index the element of array.
387+
Sometimes, the element can be identified by its specific property such as `name`. So you can state [x-ms-identifiers](https://github.com/Azure/autorest/blob/main/docs/extensions/readme.md#x-ms-identifiers) in swagger,
388+
and we will replace the index argument by that.
389+
390+
![generate_subcommands_with_x_ms_identifiers](../../assets/recordings/workspace_editor/generate_subcommands_with_x_ms_identifiers.gif)
391+
375392
## Export Command Models to **AAZ** repo
376393

377394
A workspace is a local place that holds command models while developing. `AAZ` Repo is where command models are kept for persistence. When you click the `Export` button, it will export the command models into `AAZ`. `AAZ` is different from workspace, it can save different version command models of the same resource.

0 commit comments

Comments
 (0)