Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nodemcu-tool --optimize doesn't work #40

Closed
T-vK opened this issue May 8, 2017 · 5 comments
Closed

nodemcu-tool --optimize doesn't work #40

T-vK opened this issue May 8, 2017 · 5 comments

Comments

@T-vK
Copy link
Contributor

T-vK commented May 8, 2017

nodemcu-tool --optimize upload init.lua results in [NodeMCU-Tool] Unknown command "init.lua".
Can anyone confirm this?

@AndiDittrich
Copy link
Owner

Dear T-vK,

i can confirm this issue...it seems to be an error within commanderjs argument parsing. but maybe it's an issue by design because NodeMCU-Tool is using a sub-command structure and the argument options are only added to the specific sub-commands. when commander tries to dispatch a command like upload it has to parse the global options first. unknown arguments may parsed in a generic way...

generally the tool should be called like this:

nodemcu-tool [global-options] <command> [command-options] args..

this causes an error
it seems that the argument parser uses upload as value of --optimize

andi@sapphire:~/Development/IoT/NodeMCU-Tool$ ./nodemcu-tool -n init.lua --optimize upload init.lua
[NodeMCU-Tool] Unknown command "init.lua"

  Usage: nodemcu-tool [options] [command]

this works..
maybe because there is an argument required by the n options

andi@sapphire:~/Development/IoT/NodeMCU-Tool$ ./nodemcu-tool --optimize -n init.lua upload init.lua
[NodeMCU-Tool] Connected
[NodeMCU] Version: 2.0.0 | ChipID: 0xd1aa | FlashID: 0x1640e0
[NodeMCU-Tool] Uploading "init.lua" >> "init.lua"...
[NodeMCU-Connector] Transfer-Mode: base64
[NodeMCU-Tool] File Transfer complete!

@T-vK
Copy link
Contributor Author

T-vK commented May 8, 2017

Wouldn't it make more sense to have --optimize, --compile etc on the right of of upload? I mean do you really consider those to be [global-options]? I thought they were specific to upload and thus should fall under [command-options].

@AndiDittrich
Copy link
Owner

i've never said that this are global options, the examples above are only used as testcase ;)

@T-vK
Copy link
Contributor Author

T-vK commented May 8, 2017

Isn't the CommandReference kind of misleading then?

@AndiDittrich
Copy link
Owner

of course, i'm currently fixing this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants