Skip to content

Commit

Permalink
Removed line break after description
Browse files Browse the repository at this point in the history
  • Loading branch information
Spacehuhn committed Jan 12, 2020
1 parent b68ca05 commit 1bf741d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Command.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ void Command::toString(String& s) const {
}

if (hasDescription()) {
s += '\n' + getDescription() + '\n';
s += '\n' + getDescription();
}
}
}
Expand Down

7 comments on commit 1bf741d

@gloglas
Copy link

@gloglas gloglas commented on 1bf741d Feb 13, 2020

Choose a reason for hiding this comment

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

Why did you decided to do this? Formatting is alright in Arduino IDE, but in screen or putty it is completely unusable.
edit: Can you instead add '\r'? It should be more pleasant.

@spacehuhn
Copy link
Collaborator

Choose a reason for hiding this comment

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

The description had a linebreak at the beginning and the end. It was repetitive, so I removed one.

@gloglas
Copy link

Choose a reason for hiding this comment

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

I am fighting with it right now.
Serial.println("cmd1\r\ncmd2\r\n Description"); makes ->

cmd1
cmd2
 Description

But Serial.println(cli.toString()); makes ->

cmd1
    cmd2
          Description

@gloglas
Copy link

Choose a reason for hiding this comment

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

If I make cmd2.setDescription(" Description"); to a -> cmd2.setDescription(" Description\r"); it helps. So I think the issue is somewhere there.

@spacehuhn
Copy link
Collaborator

Choose a reason for hiding this comment

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

If I understand you right, your problem is that you need \r\n instead of just \n.
(A proper issue would be better than commeting some commit, but whatever 😃 )

Try out this branch: https://github.com/spacehuhn/SimpleCLI/tree/linebreak

@gloglas
Copy link

Choose a reason for hiding this comment

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

Sorry, I saw the commit and I had a question, for me not worth mentioning in the issues. But thanks for the directions.

@spacehuhn
Copy link
Collaborator

Choose a reason for hiding this comment

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

Did it fix your issue?

Please sign in to comment.