Skip to content

tt run script.lua -- -h arg parsing not as written in --help #1213

@d-enk

Description

@d-enk
tt version

Tarantool CLI version 2.11.0, linux/amd64. commit: a9d884f

tt run --help
Run Tarantool instance.
All command line arguments are passed to the interpreted SCRIPT. Options to process in the SCRIPT
are passed after '--'.

USAGE
  tt run [SCRIPT.lua [flags] [-- ARGS]]

FLAGS
  -h, --help   help for run

EXAMPLES
  
# Print current environment Tarantool version:

    $ tt run --version
    Tarantool 2.11.0-entrypoint-724-gd2d7f4de3
    . . .

# Run a script (which print passed arguments) with 3 arguments and 2 options:

    $ tt run script.lua a b c -- -a -b
    a b c -a -b

# Run a script, pass '-i' argument to it, and enter interactive mode after script execution:

    $ tt run -i script.lua -- -i
    -i
    Tarantool 2.11.0-entrypoint-724-gd2d7f4de3
    type 'help' for interactive help
    tarantool>

First '-i' option is parsed by 'tt run' and means 'enter interactive mode'. The second '-i'
is after '--', so passed to script.lua as is.

# Execute stdin:

    $ echo 'print(42)' | tt run -
    42
-- script.lua
print(table.concat(arg, ","))
tt run script.lua a b c -- -a -b # a,b,c,--,-a,-b
tt run -i script.lua -- -i
# --,-i
# Tarantool 3.5.0-0-g81b5335
# type 'help' for interactive help
# tarantool> 
# Can't pass `-h` flag to script (catched by tt)
tt run script.lua -- -h # tt run --help

Was broken in 2.1.1 744a4c7

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions