Azure / Azure/azure-cli

Parameters with spaces are split into separate arguments by the arg parser (knack?) even when quoted for bash

Open
#25,327 11 comments 0 reactions 0 assignees View on GitHub
act-platform-engineering-squad bug Customer Usage DevOps Service Attention
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

### **This is autogenerated. Please review and update as needed.**

## Describe the bug
I have a couple of examples of this, but the latest is the using the --team parameter in the `az boards iteration teams list` command. Instead of taking the quoted arg to interpret it as the property value, if the value contains a space, only the first word is used as the property value, and subsequent words are interpreted as extra args.

**Command Name**
`az boards iteration team list --team "MY TEAM NAME WITH SPACES" --timeframe current` --debug

debug snippet:
```
cli.knack.cli: Command arguments: ['boards', 'iteration', 'team', 'list', '--team', 'MY', 'TEAM', 'NAME', 'WITH', 'SPACES', '--timeframe', 'current', '--debug']
```

**Errors:**
```
unrecognized arguments: TEAM NAME WITH SPACES

```
(the command thinks I passed `--team MY`, as if I had not properly quoted the parameter value argument)

## To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

- _Put any pre-requisite steps here..._
- `az boards iteration team list --team 'MY TEAM WITH A SPACE IN THE NAME' --timeframe current --org=MyOrg --project=MyProject`

## Expected Behavior
az should interpret the value of --team as "MY TEAM WITH A SPACE IN THE NAME", and pass that encoded value to the api.

## Environment Summary
```
Linux-5.19.0-29-generic-x86_64-with-glibc2.36, Ubuntu 22.10
Python 3.10.7
Installer: PIP

azure-cli 2.44.1

Extensions:
azure-devops 0.26.0

Dependencies:
msal 1.20.0
azure-mgmt-resource 21.1.0b1
```
## Additional Context

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.