Skip to content

swiftly run --help does not provide run command help #218

Closed
@bkhouri

Description

@bkhouri
❯ swiftly --version
0.4.0-dev

❯ swiftly run --help
/usr/bin/env: illegal option -- h
usage: env [-0iv] [-P utilpath] [-S string] [-u name]
           [name=value ...] [utility [argument ...]]

The workaround is to run swiftly help run

❯ swiftly help run
OVERVIEW: Run a command while proxying to the selected toolchain commands.

USAGE: swiftly run <command> ...

ARGUMENTS:
  <command>               Run a command while proxying to the selected toolchain commands.

        Run a command with a selected toolchain. The toolchain commands become the default in the system path.

        You can run one of the usual toolchain commands directly:

            $ swiftly run swift build

        Or you can run another program (or script) that runs one or more toolchain commands:

            $ CC=clang swiftly run make  # Builds targets using clang
            $ swiftly run ./build-things.sh  # Script invokes 'swift build' to create certain product binaries

        Toolchain selection is determined by swift version files `.swift-version`, with a default global as the fallback. See the `swiftly use` command for more details.

        You can also override the selection mechanisms temporarily for the duration of the command using a special syntax. An argument prefixed with a '+' will be treated as the selector.

            $ swiftly run swift build +latest
            $ swiftly run swift build +5.10.1

        The first command builds the swift package with the latest toolchain and the second selects the 5.10.1 toolchain. Note that if these aren't installed then run will fail with an error message. You can pre-install the toolchain using `swiftly install <toolchain>` to ensure success.

        If the command that you are running needs the arguments with the '+' prefixes then you can escape it by doubling the '++'.

            $ swiftly run ./myscript.sh ++abcde

        The script will receive the argument as '+abcde'. If there are multiple arguments with the '+' prefix that should be escaped you can disable the selection using a '++' argument, which turns off any selector argument processing for subsequent arguments. This is anologous to the '--' that turns off flag and option
        processing for subsequent arguments in many argument parsers.

            $ swiftly run ./myscript.sh ++ +abcde +xyz

        The script will receive the argument '+abcde' followed by '+xyz'.

OPTIONS:
  --version               Show the version.
  -h, --help              Show help information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions