alex-rudakov / sphinx-argparse

Sphinx extension that automatically document argparse commands and options
MIT License
49 stars 40 forks source link

Default arguments with string values should have strings in the output documentation #36

Closed kratsg closed 8 years ago

kratsg commented 8 years ago
screenshot 2016-01-08 11 04 06
lsf = drivers_parser.add_parser('lsf', help='Flock your jobs to lsf', usage=baseUsageStr.format('lsf'), formatter_class=lambda prog: CustomFormatter(prog, max_help_position=30))
lsf.add_argument('--optLSFConf', metavar='', type=str, required=False, default='-q short')
lsf.add_argument('--optLSFNFilesPerJob', metavar='', type=int, required=False, default=1)

As you can see, it looks like it suggests people should write --optLSFConf=-q short instead of --optLSFConf="-q short".

dpryan79 commented 8 years ago

My preferred solution would be to only put the defaults in quotes in cases where it includes a space. Would that suffice to you or do you have any other thoughts there?

dpryan79 commented 8 years ago

BTW, I have a branch (feature/quote_help_strings_fix36) that implements my suggestion. Please feel free to give it a try!

kratsg commented 8 years ago

@dpryan79 I think it should always include quotes.

dpryan79 commented 8 years ago

Fine by me, that's what I'll implement then :)

dpryan79 commented 8 years ago

This is now implemented as requested in the develop branch.