dstack icon indicating copy to clipboard operation
dstack copied to clipboard

[Bug]: Cannot see `dstack run --help`

Open jvstme opened this issue 5 months ago • 5 comments

Steps to reproduce

dstack run --help

Expected output

Usage: dstack run [--project NAME] [-h [TYPE]] [-f FILE] [-n RUN_NAME] [-d] [-y] [--max-offers MAX_OFFERS] [--profile NAME] [--max-price PRICE] [--max-duration DURATION] [-b NAME] [-r NAME]
                  [--pool POOL_NAME | --reuse | --dont-destroy | --idle-duration IDLE_DURATION | --instance NAME] [--spot | --on-demand | --spot-auto | --spot-policy POLICY]
                  [--retry | --no-retry | --retry-limit DURATION] [-e KEY=VALUE] [--gpu SPEC] [--disk RANGE]
                  working_dir

Positional Arguments:
  working_dir

Options:
  --project NAME        The name of the project. Defaults to $DSTACK_PROJECT
  -h, --help [TYPE]     Show this help message and exit. TYPE is one of task, dev-environment, service
  -f, --file FILE       The path to the run configuration file. Defaults to WORKING_DIR/.dstack.yml

... etc ...

Actual output

Usage: dstack run [--project NAME] [-h [TYPE]] [-f FILE] [-n RUN_NAME] [-d] [-y] [--max-offers MAX_OFFERS] [--profile NAME] [--max-price PRICE] [--max-duration DURATION] [-b NAME] [-r NAME]
                 [--pool POOL_NAME | --reuse | --dont-destroy | --idle-duration IDLE_DURATION | --instance NAME] [--spot | --on-demand | --spot-auto | --spot-policy POLICY]
                 [--retry | --no-retry | --retry-limit DURATION]
                 working_dir
dstack run: error: the following arguments are required: working_dir

Note: The workaround is to use dstack run . --help. This workaround is mentioned in the docs, so the docs will have to be updated once this is fixed

jvstme avatar Mar 11 '24 17:03 jvstme

This bug exists because of the implementation of different help messages for different run configurations: --help task, --help dev-environment, and --help service. But according to @peterschmidt85, the --help [TYPE] syntax is not very important, so it is possible to discard it in case this helps fix the bug

jvstme avatar Mar 12 '24 09:03 jvstme

@jvstme I suggest that we display all supported arguments regardless of the configuration and allow for invoking 'dstack --help' without parameters. Feel free to take on this task once you finish your current one!

peterschmidt85 avatar Mar 29 '24 13:03 peterschmidt85

This issue is stale because it has been open for 30 days with no activity.

peterschmidt85 avatar Apr 29 '24 01:04 peterschmidt85