SmartBear-DevRel / explore-cli

Simple utility CLI for importing and exporting data to and from SwaggerHub Explore
https://www.nuget.org/packages/Explore.Cli
Apache License 2.0
5 stars 4 forks source link

Add `-n, --names` option to specify space names to export #14

Closed Yousef-Majidi closed 11 months ago

Yousef-Majidi commented 12 months ago

I've added a new option: --names and added it to the ExportSpaces method. When provided, it is a comma separated string, but the values are trimmed. So, both "test1,test2" and "test1, test2" will work.

Let me know if you need any changes.

closes #4

frankkilcommins commented 12 months ago

Thanks for this......added a few comments above

Yousef-Majidi commented 12 months ago

Hi @frankkilcommins. I've made the requested changes. I added a check for valid file extensions. I also added a check for the \ or / character in the file name. I handled the permission checks. I also modified the exportPath variable. Using -fp, --file-path now.

Let me know if you need more changes.

frankkilcommins commented 12 months ago

Thanks for all the work. Nearly there I reckon. Could you also supply some information on how you tested/verified the changes?

Yousef-Majidi commented 12 months ago
Yousef-Majidi commented 12 months ago

Thanks for all the work. Nearly there I reckon. Could you also supply some information on how you tested/verified the changes?

I'm testing by manually building the app and testing it with my own account. All of the new commands added are easily verifiable by checking the output after each test.

The validation checks are tested with the unit tester, but I realize some of them failed after the push. I will have a look at this in the next couple of days. It's an OS dependant problem I think. Because GetInvalidChars is not guaranteed to contain a complete set of characters that are invalid.

Also about the validation unit tests, I wasn't able to figure out a way to effectively test the permission checking with the unit tester. But I did extensively check it manually. Perhaps you know how to do that and can help me with it. Thank you!

Yousef-Majidi commented 11 months ago

Hi @frankkilcommins. Sorry for the delay in fixing this. But I came up with somewhat of a brute force solution for the failed tests. Please review and let me know if you have a better solution. I think I already covered everything else that was requested. But if I missed anything, please let me know.