Compare commits

...

3 commits

Author SHA1 Message Date
0352b2b2aa bump: version 1.0.0rc0 → 1.0.0 2026-06-21 17:21:02 +02:00
13e561fdc0 fix: tiramisu dependencies 2026-06-21 17:20:37 +02:00
ae2e30ebb7 fix: black 2026-06-21 17:09:52 +02:00
4 changed files with 32 additions and 65 deletions

View file

@ -1,72 +1,24 @@
## 0.7.0a7 (2026-06-12) ## 1.0.0 (2026-06-21)
### Fix
- remove prog and description attribute
- support exit_on_error
## 0.7.0a6 (2026-06-11)
### Feat ### Feat
- allow undefined option - allow undefined option
## 0.7.0a5 (2025-12-30)
## 0.7.0a4 (2025-11-21)
### Feat
- add 'add_help' option un TiramisuCmdLineParser - add 'add_help' option un TiramisuCmdLineParser
## 0.7.0a3 (2025-10-10)
### Feat
- do not exit() with exit_on_error to False - do not exit() with exit_on_error to False
### Fix
- update test
## 0.7.0a2 (2025-09-29)
### Fix
- better support for boolean help
## 0.7.0a1 (2025-05-12)
### Fix
- black
## 0.7.0a0 (2025-04-30)
### Feat
- for boolean always add --xxx and --no-xxx - for boolean always add --xxx and --no-xxx
### Fix ### Fix
- tiramisu dependencies
- black
- remove prog and description attribute
- support exit_on_error
- update test
- better support for boolean help
- black
- formatter.short_name_max_len for symlink - formatter.short_name_max_len for symlink
## 0.6.2rc2 (2025-04-09)
### Fix
- version - version
## 0.6.2rc1 (2025-03-19)
### Fix
- better leader support - better leader support
## 0.6.2rc0 (2025-01-03)
### Fix
- python 2.12 support - python 2.12 support
## 0.6.1 (2024-11-06) ## 0.6.1 (2024-11-06)

View file

@ -4,7 +4,7 @@ requires = ["flit_core >=3.8.0,<4"]
[project] [project]
name = "tiramisu_cmdline_parser" name = "tiramisu_cmdline_parser"
version = "1.0.0rc0" version = "1.0.0"
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"
@ -28,7 +28,7 @@ classifiers = [
] ]
dependencies = [ dependencies = [
"tiramisu >= 5.0,<6", "tiramisu > 5.1,<6",
] ]
[project.urls] [project.urls]

View file

@ -1 +1 @@
__version__ = "1.0.0rc0" __version__ = "1.0.0"

View file

@ -27,7 +27,12 @@ from gettext import gettext as _
# try: # try:
from tiramisu import Config from tiramisu import Config
from tiramisu.error import PropertiesOptionError, LeadershipError, ConfigError, AttributeOptionError from tiramisu.error import (
PropertiesOptionError,
LeadershipError,
ConfigError,
AttributeOptionError,
)
def get_choice_list(config, properties, display): def get_choice_list(config, properties, display):
@ -336,7 +341,9 @@ class TiramisuCmdlineParser(ArgumentParser):
self.fullpath = fullpath self.fullpath = fullpath
self.config = config self.config = config
config_properties = config.property.get() config_properties = config.property.get()
self.config_frozen = "frozen" in config_properties or "everything_frozen" in config_properties self.config_frozen = (
"frozen" in config_properties or "everything_frozen" in config_properties
)
self.root = root self.root = root
self.remove_empty_od = remove_empty_od self.remove_empty_od = remove_empty_od
self.unrestraint = unrestraint self.unrestraint = unrestraint
@ -361,7 +368,9 @@ 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, exit_on_error=exit_on_error, **kwargs) super().__init__(
*args, add_help=add_help, exit_on_error=exit_on_error, **kwargs
)
self.register("action", "help", _TiramisuHelpAction) self.register("action", "help", _TiramisuHelpAction)
self._config_to_argparser( self._config_to_argparser(
_forhelp, _forhelp,
@ -692,7 +701,11 @@ class TiramisuCmdlineParser(ArgumentParser):
kwargs["type"] = float kwargs["type"] = float
else: else:
pass pass
if not _forhelp and option.type() != "boolean" and "nargs" not in kwargs.kwargs: if (
not _forhelp
and option.type() != "boolean"
and "nargs" not in kwargs.kwargs
):
kwargs["nargs"] = "?" kwargs["nargs"] = "?"
actions.setdefault(kwargs.ga_name, []).append(kwargs) actions.setdefault(kwargs.ga_name, []).append(kwargs)
@ -705,9 +718,11 @@ class TiramisuCmdlineParser(ArgumentParser):
group.add_argument(*args, **kwargs) group.add_argument(*args, **kwargs)
def parse_args(self, *args, valid_mandatory=True, **kwargs): def parse_args(self, *args, valid_mandatory=True, **kwargs):
namespaces, unknown = self.parse_known_args(*args, valid_mandatory=valid_mandatory, **kwargs) namespaces, unknown = self.parse_known_args(
*args, valid_mandatory=valid_mandatory, **kwargs
)
if unknown: if unknown:
msg_unknown = 'unrecognized arguments: %s' % ' '.join(unknown) msg_unknown = "unrecognized arguments: %s" % " ".join(unknown)
if self.exit_on_error: if self.exit_on_error:
self.error(msg_unknown) self.error(msg_unknown)
else: else: