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

listing the available toplevel directives with #help #6113

Closed
vicuna opened this issue Aug 1, 2013 · 5 comments
Closed

listing the available toplevel directives with #help #6113

vicuna opened this issue Aug 1, 2013 · 5 comments

Comments

@vicuna
Copy link

vicuna commented Aug 1, 2013

Original bug ID: 6113
Reporter: berenger
Assigned to: @gasche
Status: closed (set by @xavierleroy on 2017-02-16T14:18:04Z)
Resolution: fixed
Priority: normal
Severity: feature
Fixed in version: 4.03.0+dev / +beta1
Category: ~DO NOT USE (was: OCaml general)
Tags: patch, junior_job
Has duplicate: #6891
Monitored by: @hcarty

Bug description

Hello,

It would be nice if there was a way to list
all the directives the toplevel understands
(plus a short description for each, at least).

Thanks,
F.

File attachments

@vicuna
Copy link
Author

vicuna commented Aug 4, 2013

Comment author: gian

I've made a patch for this.

  • Printing on large descriptions looks bad in my opinion, so I made small descriptions based on the ones on Caml's manual. Perhaps someone more knowledgeable can provide better descriptions.
  • In order to maintain compatibility with other programs that add directives to the compiler I had to make a second hashtable with the names as key and the descriptions as value. To avoid such problems in the future I added a new function that handles new entries to the hashtable. Perhaps the new hashtable can be changed to hold a list of strings as information instead of just the description.
  • #help will print all directives (including directives that have been added by other libraries) along with their description if it exists. It will only look for directives on the original hashtable (so directives from other libraries) if the size of the hashtables don't match.

@vicuna
Copy link
Author

vicuna commented Apr 27, 2014

Comment author: berke.durak

Here's a shorter, less intrusive version that doesn't have descriptions but prints the directive argument types.

This is a stop-gap solution, esp. since module X = Foo won't print the signature anymore. I agree that descriptions would be better.

@vicuna
Copy link
Author

vicuna commented Jun 5, 2015

Comment author: @gasche

This feature was just requested again. I only had a very quick look, but it personally seems to me that gian's patch is reasonable in terms of invasiveness -- and I think having short descriptions is important. Integrating the "expected arguments" information of Berke's patch on top of it would be very nice.

@vicuna
Copy link
Author

vicuna commented Dec 25, 2015

Comment author: fdsouthern

I've tried to combine the patches given above, as well as extend it to the new(?) directives that weren't covered. I've submitted a pull request on Github. Please let me know if there's anything I should have done differently.

@vicuna
Copy link
Author

vicuna commented Dec 25, 2015

Comment author: @gasche

There is an unfortunate duplication of work between
#46
and
#376
probably due to a lack of communication of my part.

The easiest way to solve the problem is to merge the feature and close the bug. I'll merge both patchesets and commit them.

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