dreampi icon indicating copy to clipboard operation
dreampi copied to clipboard

Can't use '--enable-port-forwarding' and/or '--disable-dial-tone' flags because len(sys.argv) != 2

Open ABelliqueux opened this issue 1 year ago • 0 comments

Right now, when trying to use thoise flags, you're met with :

Usage: dreampi/dreampi.py start|stop|restart

This is because in 'dreamppi.py', l.701 ;

https://github.com/Kazade/dreampi/blob/4937c8030141e2531fc9e5fdc05a4139b5007e00/dreampi.py#L701

but when using flags, e.g ;sudo dreampi.py start --disable-dial-tone, len(sys.argv) is equal to 3, and can be 4 if both flags are combined.

In order to accept those flags, l.701 could become, but I've not investigated if it breaks something :

if len(sys.argv) >= 2:

Better usage message

Also, maybe the usage message at l.712 could specify that flags should follow the start/stop/restart directive, i.e :

        print(("Usage: %s start|stop|restart [FLAGS]" % sys.argv[0]))

instead of

https://github.com/Kazade/dreampi/blob/4937c8030141e2531fc9e5fdc05a4139b5007e00/dreampi.py#L712

I can submit a PR if those solutions look ok to you.

ABelliqueux avatar Apr 28 '23 10:04 ABelliqueux