Skip to content

Commit

Permalink
(PDK-408) Explain PowerShell escaping for -- on bundle
Browse files Browse the repository at this point in the history
PowerShell evaluates '--' itself and doesn't pass it on to the pdk
function. The backtick stops PowerShell from further argument parsing
and saves the double dash from being gobbled up.

To make it easier to discover by windows users, this also changes the
usage, when run on windows.
  • Loading branch information
DavidS committed Oct 4, 2017
1 parent 048c02f commit 1aa842d
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions lib/pdk/cli/bundle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,19 @@
module PDK::CLI
@bundle_cmd = @base_cmd.define_command do
name 'bundle'
usage _('bundle -- [bundler_options]')
if Gem.win_platform?
usage _('bundle `-- [bundler_options]')
else
usage _('bundle -- [bundler_options]')
end
summary _('(Experimental) Command pass-through to bundler')
description _('[experimental] For advanced users, pdk bundle runs arbitrary commands in the bundler environment that pdk manages.' \
'Careless use of this command can lead to errors that pdk can\'t help recover from.')
description _(<<-EOF
[experimental] For advanced users, pdk bundle runs arbitrary commands in the bundler environment that pdk manages.
Careless use of this command can lead to errors that pdk can't help recover from.
Note that for PowerShell the '--' needs to be escaped using a backtick: '`--' to avoid it being parsed by the shell.
EOF
)

be_hidden

Expand Down

0 comments on commit 1aa842d

Please sign in to comment.