Symptoms: the Scope URL are printed this way:
```
Weave Scope is reachable at the following URL(s):
* http://10.2.2.1
172.16.28.1
172.16.28.1
192.168.99.1
192.168.35.117
172.16.28.1
172.16.28.1
192.168.122.1:4040/
```
Regression from https://github.com/weaveworks/scope/pull/2068
Instead of different usage info for "scope help", show the same always.
Also correct it for what the script actually does,
and always display the scope binary args.
As indicated by the TODO, any args passed into the command do not get escaped
when output, so for example:
scope command "foo bar"
would output results like:
foo bar
instead of
"foo bar"
or
foo\ bar
The "right" way to do this seems to be printf %q, which prints a quoted version of the string.
However this format specifier is not available in POSIX sh (though it does work in many
implementations of it, such as the ones provided by bash which make up the likely majority of
real-world usage).
This code is a compromise that uses the added functionality where available,
while still falling back to the old behaviour when it isn't.
By far the majority of these were variables which were not quoted.
While, yes, right now we can guarentee most of these variables will never contain spaces,
this could someday change and applying quoting as a universal rule prevents future mistakes.
The ARGS="$@" -> "$*" change is purely stylistic and mainly is used to indicate the intent that
we actually wanted to concatenate all the args by spaces, not keep them seperated as "$@" would
in many situations, but not this one.
Several warnings remain, in places where we intentionally want to split a variable on whitespace,
or otherwise do what shellcheck is warning us against.
Of note is shellcheck warning SC2166, which says to prefer [ foo ] || [ bar ] over [ foo -o bar ]
as the -a and -o flags have differing behaviour on some systems.
I've opted to keep these for now, since the version check test command would need to be replaced by
a LOT of subshells to achieve the same effect, which feels dirtier.
* Add dry run flag to scope, so when launched we can check the args are valid.
* Try and parse listen address and error early.
* Specify that -dry-run is for internal use only.
* Make Scope work on Docker for Mac (#1414)
* Check if Docker for Mac is used and run app separately
* Improve `check_probe_only`
* Fix d4m detection
* Fix Docker for Mac test by checking if it is in use
Squash of:
* Include plugins in the report
* show plugin list in the UI
* moving metric and metadata templates into the probe reports
* update js for prime -> priority
* added retry to plugin handshake
* added iowait plugin
* review feedback
* plugin documentation