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

Help text on Windows misleading #93

Closed
ReinhardKeil opened this issue May 30, 2022 · 4 comments
Closed

Help text on Windows misleading #93

ReinhardKeil opened this issue May 30, 2022 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@ReinhardKeil
Copy link

ReinhardKeil commented May 30, 2022

Describe the bug
On windows the help message for -R option is somewhat confusing

Instead of:

  -R, --pack-root string   Specifies pack root folder. Defaults to CMSIS_PACK_ROOT environment variable (default "C:\\Users\\reikei01\\AppData\\Local\\Arm\\Packs")

It should be:

  -R, --pack-root string   Specifies pack root folder. Defaults to CMSIS_PACK_ROOT environment variable (default "C:\Users\reikei01\AppData\Local\Arm\Packs")

To Reproduce
Steps to reproduce the behavior:

  1. Run the cpackget on Windows 10 with the following command line
cpackget add -h

Note that this issue might exist in other places too.


With the command cpackget index -h (on Windows) there is another misleading output.

Instead of:

Updates the public index in CMSIS_PACK_ROOT/.Web/index.pidx using the file specified by the given url.

it could be

Updates the public index in %CMSIS_PACK_ROOT%/.Web/index.pidx using the file specified by the given url.

I believe the %CMSIS_PACK_ROOT% notation also works on Linux

@chaws
Copy link
Contributor

chaws commented May 30, 2022

-R, --pack-root string Specifies pack root folder. Defaults to CMSIS_PACK_ROOT environment variable (default "C:\\Users\\reikei01\\AppData\\Local\\Arm\\Packs")

The path is being escaped. I'll look into getting the path in this and other places un-escaped as well. The same for the environment variable notation.

@jkrech jkrech added the bug Something isn't working label May 31, 2022
@chaws chaws assigned lud0v1c and unassigned chaws May 31, 2022
@lud0v1c
Copy link
Contributor

lud0v1c commented Jun 6, 2022

Tested several different shells in Windows and ways to replace the printed path, but I think it's related to the module used for the commands (cobra). Opened an issue there to get some feedback on it, as it only seems to happen in Windows.

@lud0v1c
Copy link
Contributor

lud0v1c commented Jun 22, 2022

As per the modules contributor's response, it seems possible to implement a custom type of Flag that would format the Usage text in a different manner, not escaping the backslashes. Will look into how feasible it is to implement it.

lud0v1c added a commit to lud0v1c/cpackget that referenced this issue Jun 27, 2022
Prints CMSIS_PACK_ROOT value in the index and update-index command descriptions, with a different output based on OS.

Addresses Open-CMSIS-Pack#93.
@lud0v1c
Copy link
Contributor

lud0v1c commented Jul 5, 2022

Closing this for now, subscribed to the Cobra issue in case any relevant updates or the pending PR is pushed as not to add such additional complexity (the first part is already done ).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants