Skip to content

Commit

Permalink
powershell: ActionMessage message as description
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Apr 14, 2020
1 parent ec81a0d commit e36b9e1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 4 additions & 2 deletions example/cmd/root_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,10 @@ Register-ArgumentCompleter -Native -CommandName 'example' -ScriptBlock {
break
}
'^(-m|--message)$' {
[CompletionResult]::new('ERR ', 'ERR', [CompletionResultType]::ParameterValue, ' ')
[CompletionResult]::new('message` + "`" + ` example ', 'message example', [CompletionResultType]::ParameterValue, ' ')
[CompletionResult]::new('_ ', '_', [CompletionResultType]::ParameterValue, 'message example')
[CompletionResult]::new('ERR ', 'ERR', [CompletionResultType]::ParameterValue, 'message example')
break
}
'^(--multi_parts)$' {
Expand Down
8 changes: 4 additions & 4 deletions powershell/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ func ActionFiles(suffix string) string {
}

func ActionNetInterfaces() string {
return `$(Get-NetAdapter).Name`
return `$(Get-NetAdapter).Name` // TODO test this
}

func ActionUsers() string {
return `$(Get-LocalUser).Name`
return `$(Get-LocalUser).Name` // TODO test this
}

func ActionGroups() string {
return `$(Get-Localgroup).Name`
return `$(Get-Localgroup).Name` // TODO test this
}

func ActionHosts() string {
Expand Down Expand Up @@ -91,7 +91,7 @@ func ActionValuesDescribed(values ...string) string {
}

func ActionMessage(msg string) string {
return ActionValues("ERR", msg)
return ActionValuesDescribed("_", msg, "ERR", msg)
}

func ActionMultiParts(separator rune, values ...string) string {
Expand Down

0 comments on commit e36b9e1

Please sign in to comment.