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

Refactor: move usage string to the constant #3480

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alexandear
Copy link
Contributor

The PR moves usage string to a constant to improve readability and maintainability.

The micro's output remains the same

Before:

$ ./micro -h > before.txt

After this PR:

./micro -h > after.txt

Diff is empty:

diff before.txt after.txt

@@ -29,6 +29,49 @@ import (
"github.com/zyedidia/tcell/v2"
)

const usage = `Usage: micro [OPTIONS] [FILE]...
-clean
Cleans the configuration directory
Copy link
Collaborator

Choose a reason for hiding this comment

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

With hltaberrors enabled, the leading spaces here are highlighted as an error..

Why do we even print both spaces and a tab (" \t")? Can't we print just a tab, or just 8 spaces?

Cleans the configuration directory
-config-dir dir
Specify a custom location for the configuration directory
[FILE]:LINE:COL (if the ` + "`parsecursor`" + ` option is enabled)
Copy link
Collaborator

Choose a reason for hiding this comment

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

So this makes it not so unquestionable whether the code actually becomes more readable?

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.

2 participants