Posted 18 years ago
by karl
-
Senior Software Architect,
Shelltools, LLC
iterating backwards by scope
i have a contenxt is which to do "intellisense" i need to look backwards.. here is an example
get-command "blablabla" -sth
when i type the - before something, i will lookback in the stream for an CmdLetToken (which get-commands is matching based on the XML definition).. and then use that to find out the parameters i should show..
in a simple situation this is easy (i just readreverse until i hit a cmdlet token or a lineterminatingtoken. However something liek this is a bit harder
get-command $(other-cmdlet "balbla ) -sth
or
get-command { other-cmdlet
"something else" } -sth
IS THERE a way i can read back in the same "scope" level that i am?
Karl
i have a contenxt is which to do "intellisense" i need to look backwards.. here is an example
get-command "blablabla" -sth
when i type the - before something, i will lookback in the stream for an CmdLetToken (which get-commands is matching based on the XML definition).. and then use that to find out the parameters i should show..
in a simple situation this is easy (i just readreverse until i hit a cmdlet token or a lineterminatingtoken. However something liek this is a bit harder
get-command $(other-cmdlet "balbla ) -sth
or
get-command { other-cmdlet
"something else" } -sth
IS THERE a way i can read back in the same "scope" level that i am?
Karl