Project

General

Profile

Support #17121

Docstrings.

Added by Brett Viren over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Low
Assignee:
-
Target version:
-
Start date:
07/07/2017
Due date:
% Done:

100%

Estimated time:
Duration:

Description

This is just a "wishlist" feature request.

I've been enjoying to learn to use the methods for FHiCL validation. Eg, based on `art::ToolConfigTable<>` as discussed recently on the larsoft list.

And I like how the small effort to define the needed C++ struct gives other benifits like fleshing out the output of `art --print-description MyTool` with useful information for the user.

This would be even more useful to the user if the developer could associate some short docstrings to each declared entry in the C++ struct so that they could then also be printed.

My naive suggestion is to allow an optional, second argument to `fhicl::Name()` which might be used like:

struct Config {
  typedef fhicl::Sequence<std::string> string_list_t;
  string_list_t paths { fhicl::Name("paths", "List of paths in which to search for files") };
}

and then instrument whatever streamer produces the --print-description to include any docstrings. (maybe something in art?).

Thanks for consideration.

History

#1 Updated by Kyle Knoepfel over 2 years ago

  • Description updated (diff)

#2 Updated by Kyle Knoepfel over 2 years ago

  • Status changed from New to Feedback

You should be able to add a fhicl::Comment to any of the fhiclcpp types. For example:

struct Config {
  typedef fhicl::Sequence<std::string> string_list_t;
  string_list_t paths { fhicl::Name("paths"), fhicl::Comment("List of paths in which to search for files") };
}

The comment is then printed out above the parameter whenever --print-description is invoked.

Does this meet the need?

#3 Updated by Brett Viren over 2 years ago

Wow, you are fast! Yes, this is perfect. Sorry for the noise of this ticket.

#4 Updated by Kyle Knoepfel over 2 years ago

  • Status changed from Feedback to Resolved
  • % Done changed from 0 to 100

#5 Updated by Kyle Knoepfel over 2 years ago

  • Tracker changed from Feature to Support
  • Status changed from Resolved to Closed


Also available in: Atom PDF