mkideal / cli

CLI - A package for building command line app with go
MIT License
730 stars 43 forks source link

Excessive spacing with defaults when in NormalStyle #42

Closed suntong closed 6 years ago

suntong commented 7 years ago

Hope the help text can use double lines when using jsonfile in NormalStyle. Otherwise the option + default file will make the option section too wide and text section too narrow. Here is the contrast:

# Without  jsonfile option
Options:

  -h, --help       display help information
  -U, --rul        usage URL from ISP
      --css        css selection for usage text from usage rul
      --to         email address to send to
      --template   mail sending command template string
  -d, --days       days to shift from billing date
  -v, --verbose    Verbose mode (Multiple -v options increase the verbosity.)

# With  jsonfile option
  -h, --help                        display help information
  -U, --rul                         usage URL from ISP
      --css                         css selection for usage text from usage rul
      --to                          email address to send to
      --template                    mail sending command template string
  -d, --days                        days to shift from billing date
  -v, --verbose                     Verbose mode (Multiple -v options increase the verbosity.)
  -c, --config[=cfg_default.json]   config file

Too much space has been wasted in the second case.

I know there is also a ManualStyle, but that will make the help text too long if there are a few options. So using the second line for the default value seems to be a good compromise.

 -c, --config            config file
    [=cfg_default.json]

Please consider. Thx.

suntong commented 6 years ago

For details about the fix,

Refer to https://github.com/go-easygen/wireframe/wiki/UsageStyle-of-package-cli

mkideal commented 6 years ago

How should I merge these changes?

suntong commented 6 years ago

Oh, ..., seeing that you are redoing everything, I thought you'll be continue along that path.

Now that the two repos have diverged, there is no longer any easy way to merge them.

If I were you, I'd

Otherwise, I see no way unless redoing everything manually.

suntong commented 6 years ago

If the above all seems too complicated, I can help with my part. I.e., we divide and conquer -- I do the merge part you do the afterward-fixing. Alright?

mkideal commented 6 years ago

Alright. thx

suntong commented 6 years ago

OK. Will do this weekend.

It's a huge change, so please review what I proposed again so that you completely understand what I'll be doing. If have any doubts, please let me know ASAP, as the least thing I want is to have my hard efforts rejected due to some misunderstanding.

Just to make sure. Pls confirm. Cheers.

mkideal commented 6 years ago

What issues are included in these changes? Just #42,#43?

suntong commented 6 years ago

Well, actually I was talking about auto-merging all those changes that enhanced in the temp repo (ref: change log) since the cli dormant stage, done by meisterluk (committed on Jan 14) and me. Ref: #47.

That's why I said it's huge. This is the only way to do auto-merging.

Otherwise, I see no way unless redoing everything manually.

Thus, please think twice.

suntong commented 6 years ago

Hold on, maybe there are ways to cherry-pick what to merge back, but I've never done it before.

So now I'm thinking the best approach is for you to cherry-pick from the enhanced temp repo back to cli, since I've never done it before either (else, I can auto-merging all those changes for you).

Still the very first step is still to revert to the point before the diverge (while keeping all your new changes in the history).

mkideal commented 6 years ago

Maybe you can create a PR, then I merge it.

suntong commented 6 years ago

Yeah, that's the plan. You meant PR that auto-merging all those changes right?

mkideal commented 6 years ago

You meant PR that auto-merging all those changes right?

Maybe I need to manually merge to resolve conflicts

mkideal commented 6 years ago

Please wait. I try manually merge first.

suntong commented 6 years ago

sorry, you always only say half the sentence. I never know exactly what you plan is. I'll stop chasing you around asking followup and confirmation questions.

So unless I got clear instruction from you what I should do, I'll assume you will be doing everything. If you need my help, please describe exactly what I should do.

thx. G'd night.

suntong commented 6 years ago

Ah, saw you update. Good, I'll leave it with you...

mkideal commented 6 years ago

Finished! See commit 7858d40

mkideal commented 6 years ago

NOTE: I have not used your submission for #40. See #40 for details

mkideal commented 6 years ago

I made a mistake!I push commits to go-easygen/cli, >..<

suntong commented 6 years ago

NOTE: I have not used your submission for #40. See #40 for details

Yep, understood.

I made a mistake!I push commits to go-easygen/cli,

And now you've fixed it, :)