PowerShell / PowerShell/PowerShell-RFC

Handling enums as cmdlet parameters.

オープン
#396 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
PowerShell
スター
467
フォーク
140
平均マージ
9分
マージ済み PR(30日)
1

説明

Summary of the new feature / enhancement

Changing the handling of enums as cmdlet parameters uses to display the possible values the values of the enum and the get the name for the value. Therefore xou get the same text if more than one name has the same value (see example below).

Proposed technical implementation details (optional)

<#
Display option when using an enum as a parameter of an CmdLet.
#>

Enum TestAction
{
Ignore = 0
Skip = 0
Replace = 1
New = 1
Remove = 2
Detete = 2

} # Enum TestAction

Function Test-Enum
{
param
(
[Parameter( Mandatory )]
[TestAction]
$Action
)
<#Do something#>

} # Function Test-Enum

<#
If you enter on a prompt
Test-Enum -Action
and try to select an action you get the following sequence:
Ignore
Ignore
Replace
Replace
Remove
Remove
Ignore
It would be nice to get the alias names as well.
Use [enum]::GetNames() instead [enum]::GetValues().
#>

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

issue #396 から始め、重複する enum 値を使用して enum cmdlet パラメーター補完の例を再現します。現在 enum 値を取得しているパラメーター補完のエントリーポイントを調査し、その後、補完によって Skip、New、Detete などのエイリアスを含む各名前が、値ベースの重複した候補なしに公開されることを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
powershell
領域
cli
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。