Compare commits
4 commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0352b2b2aa | |||
| 13e561fdc0 | |||
| ae2e30ebb7 | |||
| 782a4bf7e2 |
4 changed files with 32 additions and 65 deletions
64
CHANGELOG.md
64
CHANGELOG.md
|
|
@ -1,72 +1,24 @@
|
|||
## 0.7.0a7 (2026-06-12)
|
||||
|
||||
### Fix
|
||||
|
||||
- remove prog and description attribute
|
||||
- support exit_on_error
|
||||
|
||||
## 0.7.0a6 (2026-06-11)
|
||||
## 1.0.0 (2026-06-21)
|
||||
|
||||
### Feat
|
||||
|
||||
- allow undefined option
|
||||
|
||||
## 0.7.0a5 (2025-12-30)
|
||||
|
||||
## 0.7.0a4 (2025-11-21)
|
||||
|
||||
### Feat
|
||||
|
||||
- add 'add_help' option un TiramisuCmdLineParser
|
||||
|
||||
## 0.7.0a3 (2025-10-10)
|
||||
|
||||
### Feat
|
||||
|
||||
- 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
|
||||
|
||||
### 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
|
||||
|
||||
## 0.6.2rc2 (2025-04-09)
|
||||
|
||||
### Fix
|
||||
|
||||
- version
|
||||
|
||||
## 0.6.2rc1 (2025-03-19)
|
||||
|
||||
### Fix
|
||||
|
||||
- better leader support
|
||||
|
||||
## 0.6.2rc0 (2025-01-03)
|
||||
|
||||
### Fix
|
||||
|
||||
- python 2.12 support
|
||||
|
||||
## 0.6.1 (2024-11-06)
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ requires = ["flit_core >=3.8.0,<4"]
|
|||
|
||||
[project]
|
||||
name = "tiramisu_cmdline_parser"
|
||||
version = "0.7.0a7"
|
||||
version = "1.0.0"
|
||||
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
|
||||
readme = "README.md"
|
||||
description = "command-line parser using Tiramisu"
|
||||
|
|
@ -28,7 +28,7 @@ classifiers = [
|
|||
]
|
||||
|
||||
dependencies = [
|
||||
"tiramisu >= 5.0,<6",
|
||||
"tiramisu > 5.1,<6",
|
||||
]
|
||||
|
||||
[project.urls]
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
__version__ = "0.7.0a7"
|
||||
__version__ = "1.0.0"
|
||||
|
|
|
|||
|
|
@ -27,7 +27,12 @@ from gettext import gettext as _
|
|||
|
||||
# try:
|
||||
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):
|
||||
|
|
@ -336,7 +341,9 @@ class TiramisuCmdlineParser(ArgumentParser):
|
|||
self.fullpath = fullpath
|
||||
self.config = config
|
||||
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.remove_empty_od = remove_empty_od
|
||||
self.unrestraint = unrestraint
|
||||
|
|
@ -361,7 +368,9 @@ class TiramisuCmdlineParser(ArgumentParser):
|
|||
else:
|
||||
subconfig = subconfig.option(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._config_to_argparser(
|
||||
_forhelp,
|
||||
|
|
@ -692,7 +701,11 @@ class TiramisuCmdlineParser(ArgumentParser):
|
|||
kwargs["type"] = float
|
||||
else:
|
||||
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"] = "?"
|
||||
actions.setdefault(kwargs.ga_name, []).append(kwargs)
|
||||
|
||||
|
|
@ -705,9 +718,11 @@ class TiramisuCmdlineParser(ArgumentParser):
|
|||
group.add_argument(*args, **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:
|
||||
msg_unknown = 'unrecognized arguments: %s' % ' '.join(unknown)
|
||||
msg_unknown = "unrecognized arguments: %s" % " ".join(unknown)
|
||||
if self.exit_on_error:
|
||||
self.error(msg_unknown)
|
||||
else:
|
||||
|
|
|
|||
Loading…
Reference in a new issue