Skip to content

Fix for env var#16

Open
Ram-Nerpagar wants to merge 1 commit into
IBM:masterfrom
Ram-Nerpagar:ram_nerpagar
Open

Fix for env var#16
Ram-Nerpagar wants to merge 1 commit into
IBM:masterfrom
Ram-Nerpagar:ram_nerpagar

Conversation

@Ram-Nerpagar

Copy link
Copy Markdown
Contributor

Problem: nz_azConnector command was not returning error even when - was not passed to flag in command.

Solution: 1) If an user don't pass a value for a particular flag then it will error out an message. But for database,
directory and npshost flags the code will fetch the values from the environment variables even if the
user don't pass the value while running the command.
2) Code will print a proper message if user don't pass '-' to a particular flag. If user don't pass '-' to a flag
then Go language treats every argument after that particular flag as a positional argument.

Testing: 1) If user don't pass a value for db while running the command then the code will fetch the value as
"NZ_DATABASE" from the environment variables. Same for dir and npshost. Hence the code will run fine
even if the value for db, dir and npshost is not provided in the command.
2) In the command if user missed to pass '-' to storage-account then the code will consider remaining
command as a value for npshost. Hence the code will print a proper message showing that "Did you
miss '-' in any flag? If so Go treats remaining flags as the positional arguments".

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.

1 participant