poshbotio / PoshBot

Powershell-based bot framework
MIT License
538 stars 108 forks source link

Consider enabling comma separated parameter values #33

Closed RamblingCookieMonster closed 7 years ago

RamblingCookieMonster commented 7 years ago

It might be worth extending the input parser to allow comma separated array input.

Many of the commands I'm writing follow a pattern of picking a set of common default properties to return, while allowing the user to specify an array of properties (passed to select-object, thus allowing wildcards and other fun)

As is, I'm using string input, no spaces, comma separated, and splitting on comma - not pretty! I see some examples using the remaining arguments for a particular parameter - that's another alternative, but a bit less natural than commas, at least for PowerShell folks (and if folks are using positional params in Slack, remaining args option might be a bit confusing)

devblackops commented 7 years ago

We definitely need this. When I wrote the CommandParser class I was aware that passing an array to a parameter was not going to work but I put it off for another day. Hopefully we can get this working soon.

devblackops commented 7 years ago

Just found this handy module that may help with determining the parsing logic using the AST.

https://github.com/lzybkr/ShowPSAst

devblackops commented 7 years ago

The parser has been rewritten in branch feat/command-parser-ast. I've done limited testing with it but so far it's looking good.

devblackops commented 7 years ago

Merged e722cc0a939d051f07db017f70337f62e8feae1e to enable this.