Compare commits

..

No commits in common. "fc5c3f36916421a71708a6d07796bbdd66423f8b" and "9befbf0ade37d5505347a9955f9d542c9c70abbe" have entirely different histories.

4 changed files with 9 additions and 17 deletions

View file

@ -1,9 +1,3 @@
## 0.7.0a4 (2025-11-21)
### Feat
- add 'add_help' option un TiramisuCmdLineParser
## 0.7.0a3 (2025-10-10) ## 0.7.0a3 (2025-10-10)
### Feat ### Feat

View file

@ -4,7 +4,7 @@ requires = ["flit_core >=3.8.0,<4"]
[project] [project]
name = "tiramisu_cmdline_parser" name = "tiramisu_cmdline_parser"
version = "0.7.0a4" version = "0.7.0a3"
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}] authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
readme = "README.md" readme = "README.md"
description = "command-line parser using Tiramisu" description = "command-line parser using Tiramisu"

View file

@ -1 +1 @@
__version__ = "0.7.0a4" __version__ = "0.7.0a3"

View file

@ -332,7 +332,6 @@ class TiramisuCmdlineParser(ArgumentParser):
unrestraint: bool = False, unrestraint: bool = False,
add_extra_options: bool = True, add_extra_options: bool = True,
short_name_max_len: int = 1, short_name_max_len: int = 1,
add_help: bool = True,
_forhelp: bool = False, _forhelp: bool = False,
**kwargs, **kwargs,
): ):
@ -346,7 +345,6 @@ class TiramisuCmdlineParser(ArgumentParser):
self.add_extra_options = add_extra_options self.add_extra_options = add_extra_options
self.display_modified_value = display_modified_value self.display_modified_value = display_modified_value
self.short_name_max_len = short_name_max_len self.short_name_max_len = short_name_max_len
self.add_help = add_help
if TiramisuHelpFormatter not in formatter_class.__mro__: if TiramisuHelpFormatter not in formatter_class.__mro__:
formatter_class = type( formatter_class = type(
"TiramisuHelpFormatter", (TiramisuHelpFormatter, formatter_class), {} "TiramisuHelpFormatter", (TiramisuHelpFormatter, formatter_class), {}
@ -363,7 +361,7 @@ class TiramisuCmdlineParser(ArgumentParser):
else: else:
subconfig = subconfig.option(self.root) subconfig = subconfig.option(self.root)
self.namespace = TiramisuNamespace(self.config, self.root) self.namespace = TiramisuNamespace(self.config, self.root)
super().__init__(*args, add_help=add_help, **kwargs) super().__init__(*args, **kwargs)
self.register("action", "help", _TiramisuHelpAction) self.register("action", "help", _TiramisuHelpAction)
self._config_to_argparser( self._config_to_argparser(
_forhelp, _forhelp,
@ -421,16 +419,16 @@ class TiramisuCmdlineParser(ArgumentParser):
add_extra_options=self.add_extra_options, add_extra_options=self.add_extra_options,
short_name_max_len=self.short_name_max_len, short_name_max_len=self.short_name_max_len,
fullpath=self.fullpath, fullpath=self.fullpath,
add_help=self.add_help,
) )
namespace_, args_ = new_parser._parse_known_args( namespace_, args_ = new_parser._parse_known_args(
args_, new_parser.namespace, *others args_, new_parser.namespace, *others
) )
elif self._registries["action"]["help"].needs: else:
# display help only when all variables assignemnt are done if self._registries["action"]["help"].needs:
self._registries["action"]["help"].needs = False # display help only when all variables assignemnt are done
helper = self._registries["action"]["help"](None) self._registries["action"]["help"].needs = False
helper.display(self) helper = self._registries["action"]["help"](None)
helper.display(self)
return namespace_, args_ return namespace_, args_
def add_argument(self, *args, **kwargs): def add_argument(self, *args, **kwargs):