diff --git a/docs/vitepress/guide/intro/getting_started.md b/docs/vitepress/guide/intro/getting_started.md index 29e3968b..7a635de5 100644 --- a/docs/vitepress/guide/intro/getting_started.md +++ b/docs/vitepress/guide/intro/getting_started.md @@ -197,10 +197,17 @@ from trame.app import get_server server = get_server() server.cli.add_argument("-d", "--data", help="Directory to explore", dest="data") -args = server.cli.parse_args() +args = server.cli.parse_known_args()[0] print(args.data) ``` +Note that if you intend to use your own CLI parser or rely on a library which parses CLI arguments, +you need to make sure that the arguments are not overlapping with the trame server ones. +In case of CLI arguments overlapping and still requiring to pass arguments to trame server's, it is +recommended to use either the `--trame-args` flag (eg. `--trame-args="-p 1000"`) or the `TRAME_ARGS` environment variable, +which have a higher priority over CLI arguments. + + ## Starting an application The server provides a `start()` method which actually starts a trame application. Typically the following section is placed in the main script: