Command line interface not executing commands

I’m new to PX4 so please bear with me.
I created a module for a project with command line options. I use the getopts function to parse my options and arguments.
I am having some issues with the cmd line interface skipping some commands sometimes and passing it other times.
For instance, when I type:

cmd_1
I get the response I wanted - that is, a print out telling me that my command executed.
Then, I type again
cmd_1
This time, I get nothing. the command line prompt comes back with no comment, no printfs, nothing.
I have to have at least two arguments, so I should get an error if my command was incorrect. But I get just an empty prompt.

Then I type again:

cmd_1
I get the same result I got the first time - which was the response I wanted.

So to summarize:
First time input: >cmd_1
First time output: > response
Second time input: > cmd_1
Second time output: >
Third time input:>cmd_1
Third time output:>reponse

If this detail is of any importance, the function I am running interfaces with the SPI bus.