DioxusLabs / dioxus

Fullstack GUI library for web, desktop, mobile, and more.
https://dioxuslabs.com
Apache License 2.0
19.3k stars 735 forks source link

`dx`'s help message shows that the hot-reloading is disabled by default, which is false (no pun intended) #2233

Closed Andrew15-5 closed 2 months ago

Andrew15-5 commented 2 months ago

Problem

      --hot-reload
          Build with hot reloading rsx. Will not work with release builds. [default: false]

It should say true. But how would you disable it? Can you pass in true/false? Maybe there should be a --no-hot-reload option instead.

Steps To Reproduce

Steps to reproduce the behavior:

Expected behavior

The message should say true.

Environment:

Questionnaire

Apollo-Roboto commented 2 months ago

I find this flag confusing too. When trying to disable hot-reload, it throws an error:

> dx serve --hot-reload false

error: unexpected argument 'false' found

Usage: dx.exe serve [OPTIONS] [-- <CARGO_ARGS>...]

For more information, try '--help'.

It seems impossible to disable hot reload with serve.

Yash-271120 commented 2 months ago

@ealmloff Hey there! I have recently learnt about rust and would like to contribute to the issue.

Andrew15-5 commented 2 months ago

clap already adds default value if value can be set and omitted:

image

After compiling:

image