Skip to content

SvelteKit cli overlapping parameter shortcut -h #1432

Closed
@Kage0x3B

Description

@Kage0x3B

Describe the bug
The "svelte-kit" cli commands dev, preview and start have overlapping parameter shortcuts for the host parameter and the help, both shortcuts are -h. When using the shortcut, the help is always displayed and the command exits.
(Using --host instead works)

Logs

$ npx svelte-kit dev -ho

  Description
    Deprecated — use svelte-kit preview instead

  Usage
    $ svelte-kit start [options]

  Options
    -p, --port     Port  (default 3000)
    -h, --host     Host (only use this on trusted networks)  (default localhost)
    -H, --https    Use self-signed HTTPS certificate  (default false)
    -o, --open     Open a browser tab  (default false)
    -h, --help     Displays this message

To Reproduce

  • Execute the dev command npx svelte-kit dev -ho in any SvelteKit project.
  • It should then only show the help message.

Expected behavior
The development server starts, binds to 0.0.0.0 because of the -h parameter and launches the browser -o

Information about your SvelteKit Installation:

Diagnostics

System:
OS: Linux 5.4 Ubuntu 18.04.5 LTS (Bionic Beaver)
CPU: (8) x64 AMD FX(tm)-8350 Eight-Core Processor
Memory: 790.58 MB / 11.68 GB
Container: Yes
Shell: 5.4.2 - /usr/bin/zsh
Binaries:
Node: 14.16.1 - ~/.nvm/versions/node/v14.16.1/bin/node
npm: 6.14.12 - ~/.nvm/versions/node/v14.16.1/bin/npm
Browsers:
Firefox: 88.0.1
npmPackages:
@sveltejs/kit: next => 1.0.0-next.107
svelte: ^3.34.0 => 3.38.2
vite: ^2.2.4 => 2.3.1

Severity
Low, --host parameter can be used instead, just a small annoyance which might confuse users.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions