Open lea-hagen opened 4 years ago
This seems to be an issue of having different help formatting for the initial parser (-h) and the subparsers (e.g. plot_cmd -h).
For beast -h
we want:
parser = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelpFormatter)
For beast plot_cmd -h
we want:
subparsers = parser.add_subparsers(formatter_class=argparse. RawTextHelpFormatter)
The problem is that changing the subparsers format only changes the help formatting for beast -h.
Looking online it also seems that to create different help formatting for difference arguments requires custom functions, with no real easy catch-all function that I can find.
As discussed in #603, using the
beast [function]
interface doesn't show much information in its help message. Here's an example forplot_cmd
:positional arguments: filename Path to FITS file to plot
optional arguments: -h, --help show this help message and exit -s {png,jpg,jpeg,pdf,ps,eps,rgba,svg,tiff,tif,pgf,svgz,raw}, --savefig {png,jpg,jpeg,pdf,ps,eps,rgba,svg,tiff,tif,pgf,svgz,raw} Save figure to a file of specified type rather than show it. Must be one of: "png", "jpg", "jpeg", "pdf", "ps", "eps", "rgba", "svg", "tiff", "tif", "pgf", "svgz", "raw" -t, --tex Configure Matplotlib to use LaTeX; sets rcParam "usetex" to True. (Requires working TeX installation.) Defaults to false. --mag1 MAG1 Choose filter for mag1 (color=mag1-mag2) --mag2 MAG2 Choose filter for mag2 (color=mag1-mag2) --mag3 MAG3 Choose filter for the magnitude
positional arguments: fitsfile
optional arguments: -h, --help show this help message and exit --mag1_filter MAG1_FILTER --mag2_filter MAG2_FILTER --mag3_filter MAG3_FILTER --savefig SAVEFIG --show_plot SHOW_PLOT