Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

interpret the '@' syntax if something higher hasn't already done that. #1423

Merged
merged 1 commit into from
Nov 23, 2016

Conversation

brendandburns
Copy link
Member

@brendandburns brendandburns commented Nov 23, 2016

Fixes #1379
Fixes #1419

@jmspring @yugang-msft

@mention-bot
Copy link

@brendandburns, thanks for your PR! By analyzing the history of the files in this pull request, we identified @yugangw-msft, @tjprescott and @derekbekoe to be potential reviewers.

@tjprescott
Copy link
Member

@brendandburns this issue applies more generally to the CLI. See issue #1419. I think it can fixed more generally by making a change here: https://github.com/Azure/azure-cli/blob/master/src/azure-cli-core/azure/cli/core/application.py#L200

In addition to startswith('@') we can probably have something like or '=@' in ....

@derekbekoe
Copy link
Member

@brendandburns
Copy link
Member Author

@tjprescott thanks for the tip, I moved the code to that location (and I added unit tests too as a bonus!)

please take another look.

Thanks!
--brendan

@brendandburns brendandburns force-pushed the read-file branch 2 times, most recently from 5676ee3 to d210bfb Compare November 23, 2016 06:52
@tjprescott
Copy link
Member

@derekbekoe

then arguments that start with any of the specified characters will be treated as files, and will be replaced by the arguments they contain

This problem is that with foo=@bar, the @ is in the middle of the string.

if ix == -1:
return arg
# TODO: this is kind of imperfect, use a regexp here?
if ix != 0 and arg[ix - 1] != '=':
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So in the original issue, the poster reported using ="@..." so we would also need to check for that (or use a regex).

Copy link
Member

@tjprescott tjprescott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One ask. Can we allow for the foo="@bar" pattern as well?

@brendandburns
Copy link
Member Author

@tjprescott fixed (and added tests to cover it) please take another look.

Thanks
--brendan

@tjprescott
Copy link
Member

Awesome! Thank you @brendandburns !

@tjprescott tjprescott merged commit 4689982 into Azure:master Nov 23, 2016
thegalah pushed a commit to thegalah/azure-cli that referenced this pull request Nov 28, 2016
* Azure/master: (39 commits)
  User should use no-cache so we build a fresh image (Azure#1455)
  Bump all modules to version 0.1.0b10 (Azure#1454)
  [Docs] Move around the order of install instructions. (Azure#1439)
  acs: *_install_cli mark cli as executable (Azure#1449)
  Fix resource list table. (Azure#1452)
  [Compute] VM NIC updates (Azure#1421)
  Introduce batch upload and download for blob (Azure#1428)
  Add auto-registration for resource providers. (Azure#1330)
  interpret the '@' syntax if something higher hasn't already done that. (Azure#1423)
  Aliasing plan argument with shorthand (Azure#1433)
  ad:fix one more place which still uses localtime for secret starttime (Azure#1429)
  Add table formatting for deployments and sort by timestmap. (Azure#1427)
  Add table formatting for resource group list (and add 'status') (Azure#1425)
  [Docs] Add shields specifying latest version and supported python versions (Azure#1420)
  Add new az storage blob copy start-batch command (Azure#1250)
  Component Discovery (Azure#1409)
  Add poison logic to prevent re-recording tests that need updating. (Azure#1412)
  [Storage] Fix storage table outputs and help text. (Azure#1402)
  [mention-bot] Attempt to fix config (Azure#1410)
  ad:use utc time on setting app's creds (Azure#1408)
  ...
xscript pushed a commit to xscript/azure-cli that referenced this pull request Nov 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants