Skip to content

Add documentation about arguments starting with a dash (-) #4257

@milanholemans

Description

@milanholemans

Reference: #4256

When executing commands where the value of an option starts with a dash -, Minimist parses all values as flags instead of a string.

E.g.: m365 planner task get --id "-9rMKQooUjZdxgv1qQVZYABEuw"
Will be parsed as:

{
  "1": true,
  "9": true,
  "id": true,
  "r": true,
  "M": true,
  "K": true,
  "Q": true,
  "o": true,
  "U": true,
  "j": true,
  "Z": true,
  "d": true,
  "x": true,
  "g": true,
  "v": true,
  "q": true,
  "V": true,
  "Y": true,
  "A": true,
  "B": true,
  "E": true,
  "u": true,
  "w": true
}

To fix this, people should use an embedded option value with an = like: m365 planner task get --id=-9rMKQooUjZdxgv1qQVZYABEuw
This way Minimist parses the values correctly and the command works as expected.

Let's add this to the 'Use the CLI' page. https://pnp.github.io/cli-microsoft365/user-guide/using-cli/

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions