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

Fixes CLI parsing bug #289

Merged
merged 3 commits into from
Jul 7, 2022
Merged

Fixes CLI parsing bug #289

merged 3 commits into from
Jul 7, 2022

Conversation

shangabl
Copy link
Contributor

@shangabl shangabl commented Jul 7, 2022

Motivation

CLI Arg parsing errors were returning 0, this fixes that by separating the help/version arg checks to a different method

Testing

dev-dsk-shangabl-2b-cfbafac5 % ./aws-iot-device-client --foo
2022-07-07T20:07:26.651Z [ERROR] {Config.cpp}: *** AWS IOT DEVICE CLIENT FATAL ERROR: Unrecognised command line argument: --foo ***

(22-07-07 20:07:26) <1> [/tmp/deviceclient/cmake-build-debug]  
dev-dsk-shangabl-2b-cfbafac5 % echo $?
1

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

CLI Arg parsing errors were returning 0, this fixes that by separating the help/version arg checks to a different method
@@ -1985,74 +1985,87 @@ constexpr char Config::CLI_CONFIG_FILE[];
constexpr char Config::DEFAULT_FLEET_PROVISIONING_RUNTIME_CONFIG_FILE[];
constexpr char Config::DEFAULT_SAMPLE_SHADOW_OUTPUT_DIR[];

bool Config::CheckTerminalArgs(int argc, char **argv)
{
for (int i = 1; i < argc; i++)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: ++i

Copy link
Contributor

@marcoemorais-aws marcoemorais-aws left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@shangabl shangabl merged commit 8f4ee1e into main Jul 7, 2022
@shangabl shangabl deleted the cli-parse branch July 7, 2022 23:07
joenghoyin pushed a commit to eguanatech/aws-iot-device-client-deprecated that referenced this pull request Aug 29, 2023
joenghoyin pushed a commit to eguanatech/aws-iot-device-client-deprecated that referenced this pull request Aug 30, 2023
* Fixes CLI parsing bug
# Conflicts:
#	source/config/Config.cpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants