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

'mpremote help' would be nice #7480

Closed
lurch opened this issue Jul 1, 2021 · 9 comments
Closed

'mpremote help' would be nice #7480

lurch opened this issue Jul 1, 2021 · 9 comments
Labels

Comments

@lurch
Copy link
Contributor

lurch commented Jul 1, 2021

I just pip-installed mpremote and was surprised to see:

$ mpremote --help
mpremote: '--help' is not a command
$ mpremote -h
mpremote: '-h' is not a command
$ mpremote h
mpremote: 'h' is not a command
$ mpremote help
mpremote: 'help' is not a command

Simply printing out the

mpremote connect <device>        -- connect to given device
                                    device may be: list, auto, id:x, port:x
                                    or any valid device name/path
mpremote disconnect              -- disconnect current device
mpremote mount <local-dir>       -- mount local directory on device
mpremote eval <string>           -- evaluate and print the string
mpremote exec <string>           -- execute the string
mpremote run <file>              -- run the given local script
mpremote fs <command> <args...>  -- execute filesystem commands on the device
                                    command may be: cat, ls, cp, rm, mkdir, rmdir
                                    use ":" as a prefix to specify a file on the device
mpremote repl                    -- enter REPL
                                    options:
                                        --capture <file>
                                        --inject-code <string>
                                        --inject-file <file>

text (which I've just copied from https://github.com/micropython/micropython/blob/master/tools/mpremote/README.md ) would probably be sufficient?

Also, looking at the command-list above, perhaps it makes sense for mpremote list to do the same thing as mpremote connect list ?

@dpgeorge dpgeorge added the tools label Jul 2, 2021
@dpgeorge
Copy link
Member

dpgeorge commented Jul 2, 2021

Yes, help text would be great. The above sounds good to me.

Also, looking at the command-list above, perhaps it makes sense for mpremote list to do the same thing as mpremote connect list ?

I have an alias in my .config/mpremote/config.py file for exactly this:

commands = {
    "list": "connect list",
    ...
}

@lurch
Copy link
Contributor Author

lurch commented Jul 2, 2021

I have an alias in my .config/mpremote/config.py file for exactly this:

I'd argue that it's probably worth adding that directly to https://github.com/micropython/micropython/blob/master/tools/mpremote/mpremote/main.py#L28 ?

@dpgeorge
Copy link
Member

dpgeorge commented Jul 2, 2021

I'd argue that it's probably worth adding that directly to

Yes, good idea. The only concern I'd have is that it's very close to "ls" which lists files on the target board... maybe there's a better alias for "connect list" that's not as similar?

@lurch
Copy link
Contributor Author

lurch commented Jul 2, 2021

Yeah, I thought of that but I think people with a command-line background will be familiar enough with ls to know the difference? (and luckily list and ls are both "read-only" commands, i.e. no side-effects if used accidentally)
You could add something like mpremote list_connections or mpremote list_devices but that's then not any easier to type than mpremote connect list 😉

@davehylands
Copy link
Contributor

Since connect list shows you devices you can connect to, you could use the command devices to list the devices.

@dpgeorge
Copy link
Member

dpgeorge commented Jul 5, 2021

Since connect list shows you devices you can connect to, you could use the command devices to list the devices.

How about just devs for short? So:

$ mpremote devs

which is a shortcut for connect list.

@lurch
Copy link
Contributor Author

lurch commented Jul 5, 2021

Seems reasonable. As long as people wouldn't expect:

$ mpremote devs
@dpgeorge and others

😉

dpgeorge added a commit to dpgeorge/micropython that referenced this issue Aug 12, 2021
See issue micropython#7480.

Signed-off-by: Damien George <damien@micropython.org>
@dpgeorge
Copy link
Member

See #7647 to add a "devs" shortcut.

dpgeorge added a commit to dpgeorge/micropython that referenced this issue Aug 12, 2021
See issue micropython#7480.

Signed-off-by: Damien George <damien@micropython.org>
dpgeorge added a commit to dpgeorge/micropython that referenced this issue Aug 13, 2021
See issue micropython#7480.

Signed-off-by: Damien George <damien@micropython.org>
kumekay added a commit to kumekay/micropython that referenced this issue Sep 5, 2021
kumekay added a commit to kumekay/micropython that referenced this issue Sep 5, 2021
kumekay added a commit to kumekay/micropython that referenced this issue Sep 5, 2021
kumekay added a commit to kumekay/micropython that referenced this issue Dec 28, 2021
kumekay added a commit to kumekay/micropython that referenced this issue Dec 29, 2021
@dpgeorge
Copy link
Member

A help command was added in 74e995d

leifbirger pushed a commit to leifbirger/micropython that referenced this issue Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants