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

Description Text Alignment and Spacing #1

Closed
noctuid opened this issue Oct 20, 2015 · 5 comments
Closed

Description Text Alignment and Spacing #1

noctuid opened this issue Oct 20, 2015 · 5 comments
Assignees
Milestone

Comments

@noctuid
Copy link

noctuid commented Oct 20, 2015

First off, thank you for the nice library.

I have noticed that if the combination of the short opt, long opt, and meta-var is longer than the default padding before the description text, it will run into the description text and push it over without leaving a space in the help message:

-h, --help               Print this help text.
-o, --long-opt-is-long META VAR IS LONGThis is the description text.

It would be nice if the padding before the description text would automatically adjust or at least if a space would be put before the description text in this case. Also, is there some way to have the description text take up multiple lines but have each new line start at the same position (instead of all the way to the left)? For example:

-h, --help               Print this help text.
                         Print this next line aligned.

I think that would be nice as well.

On an unrelated note, emacs is indenting the args to define-opts weirdly for me. The first two "(:name ...)"s are being indented 4 spaces and the rest of them are being indented 2 spaces. Would you happen to have any idea why this is happening?

(define-opts
    (:name :help
     ...)
    (:name ...)
  (:name ...)
  (:name ...))

@mrkkrp mrkkrp added this to the 1.2.0 milestone Oct 20, 2015
@mrkkrp mrkkrp self-assigned this Oct 20, 2015
@mrkkrp
Copy link
Collaborator

mrkkrp commented Oct 20, 2015

About too long combinations of options and metavars: yes, this is absolutely possible and I will probably implement it soon.


About description text: do you mean it should happen when description contains newlines?


Yeah, I know about that problem with indentation. In Emacs Lisp, there is (declare (indent …)) thing, I'm not sure there is something similar in Common Lisp. This is because Emacs Lisp is tightly integrated with the editor, while Common Lisp cannot know anything about indentation. If you're using Emacs, you probably using SLIME. Please ask how custom macro can declare (if possible) how they should be indented. You can use this example to demonstrate the issue.

@mrkkrp
Copy link
Collaborator

mrkkrp commented Oct 20, 2015

@noctuid, Aha, I figured out that if we use &body instead of &rest in define-opts indentation is fixed. No worries, I'll commit necessary changes soon.

@mrkkrp
Copy link
Collaborator

mrkkrp commented Oct 22, 2015

@noctuid, I've decided that if combination of options and meta-var is longer than 25 characters (there are 2 character padding on the left, it doesn't count), then description will be put on the second file. This shouldn't look too ugly.

@mrkkrp mrkkrp closed this as completed in 4cd901c Oct 22, 2015
@noctuid
Copy link
Author

noctuid commented Oct 22, 2015

Great. Thank you for the changes. I'll try them when I get a chance.

@noctuid
Copy link
Author

noctuid commented Oct 22, 2015

@mrkkrp Alright, it looks good. Starting the description on the second line is what other option parsing libraries I've used in other languages do (and makes more sense than cramming all the text to the right). Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants