question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DashDash token causing remaining parameter tokens to be flagged as CommandName

See original GitHub issue

Apparently there is some special meaning to the DashDash token when it is used in command mode, but I couldn’t seem to uncover it. While trying to understand the tokenizer and parser I ran in to these two issues:

  1. A DashDash token causes further Parameter tokens to be flagged as CommandName, which can be confusing with PSReadLine if PSReadLine if changed to prioritize the highlighting of CommandName over Parameter (https://github.com/PowerShell/PSReadLine/pull/989).
  2. A DashDash token can be accepted as a command, when used with the invoke operators, but it does not get flagged with CommandName, and so causes PSReadLine to highlight it as a operator. Even when it is accepted as a command, the behavior in point 1 still occurs.

Steps to reproduce

& -- -NowACommandNameFlaggedToken

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
BrucePaycommented, Aug 13, 2019

@vexx32 Since @msftrncs seemed unclear, I just wanted to point out that there is, in fact, a very specific meaning to -- (and --%).

0reactions
msftrncscommented, Sep 19, 2019

I also see this happening for the --% verbatim argument syntax.

& --% this is now one large argument verbatim

where --% is actually a command name, but the rest of the command line is one single verbatim argument.

Read more comments on GitHub >

github_iconTop Results From Across the Web

https://proteome.gs.washington.edu/~kaipot/share/r...
src/crux And I want to run a test named <test_name> And I pass the arguments --overwrite T <args> <results> When I run spectral-counts...
Read more >
Windows PowerShell Specification
Tokens. Syntax: token: keyword variable command command-parameter command-argument-token integer-literal real-literal string-literal type-literal
Read more >
bash(1): GNU Bourne-Again SHell | Linux Man Page - Dash Dash
The remaining words are passed as arguments to the invoked command. ... Using ;;& in place of ;; causes the shell to test...
Read more >
IBM Storage Scale RAID: Administration
declustered array automatically, which causes IBM Storage Scale RAID to ... the --mmcrfs option is used to pass all remaining command line parameters...
Read more >
Alpine Technical Notes: Configuration and Preferences
When running Alpine on a UNIX system, the default built-in configuration can be changed by setting variables in the system configuration files, /usr/local/lib/ ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found