Help Generation for ROOT Related Commands By Elie Khairallah Types - - PowerPoint PPT Presentation

help generation for root related commands
SMART_READER_LITE
LIVE PREVIEW

Help Generation for ROOT Related Commands By Elie Khairallah Types - - PowerPoint PPT Presentation

Help Generation for ROOT Related Commands By Elie Khairallah Types of help Two ways to get help for the root commands Man pages ( man root.1 ) Command line option help ( root -h ) Problems with static implementation Two main


slide-1
SLIDE 1

Help Generation for ROOT Related Commands

By Elie Khairallah

slide-2
SLIDE 2

Two ways to get help for the root commands

  • Man pages (man root.1)
  • Command line option help (root -h)

Types of help

slide-3
SLIDE 3

Problems with static implementation

Two main problems

  • Man page and usage become out of sync
  • Lack of pattern

Usage as big text with examples Usage as series of option name and help message Usage written in header Usage as output stream commands Usage handled by argparse module

slide-4
SLIDE 4

First Approach

Command.md Command.1 Pandoc Lex Extract command options section

slide-5
SLIDE 5

Output and Problems

Simple! And we had the desired output on both the man page and usage level but … … …

  • Lex is not cross platform compatible
  • Additional features provided by modules like argparse should be manually reproduced

Lex Output Lex Program

slide-6
SLIDE 6

New Approach

Command-arparse.py Command.1 write_man write_header Header.h

argparse2help.py

slide-7
SLIDE 7

For the commands written in c++ we generate both header and manual. For the python file, the usage is handled by argparse directly, we need to generate the man page only.

Function generating the header file Function generating the man pages

slide-8
SLIDE 8

Commands

_ root _ rootmv _ hadd _ rootprint _ rootcling _ rootrm _ hist2workspace _ rootslimtree _ rootls _ rootmkdir _ rootbrowse _ rootcp _ rooteventselector _ rootdrawtree Python C++

slide-9
SLIDE 9

Modifications

c++ commands Python command

New rootls.py rootls-argparse.py

replace old help code by the display of the raw string in header split old code into two, one being the argparse python file

slide-10
SLIDE 10

CMAKE Is

slide-11
SLIDE 11