Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Can't add an option with name n #91

Open
deknowny opened this issue Dec 28, 2020 · 1 comment
Open

Can't add an option with name n #91

deknowny opened this issue Dec 28, 2020 · 1 comment
Labels
enhancement Improvement of an existing feature
Milestone

Comments

@deknowny
Copy link

I want to add an option with name n

{--n|names=* : Some description}

But I get this:

Traceback (most recent call last):
  File "/Users/an/Desktop/vkquick/env/bin/vq", line 2, in <module>
    from vkquick.__main__ import app
  File "/Users/an/Desktop/vkquick/vkquick/__main__.py", line 23, in <module>
    app.add_commands(New(), DebugRun(), ReleaseRun(), Com())
  File "/Users/an/Desktop/vkquick/env/lib/python3.8/site-packages/cleo/application.py", line 36, in add_commands
    self.add(command)
  File "/Users/an/Desktop/vkquick/env/lib/python3.8/site-packages/cleo/application.py", line 42, in add
    self.add_command(command.config)
  File "/Users/an/Desktop/vkquick/env/lib/python3.8/site-packages/clikit/console_application.py", line 163, in add_command
    command = Command(config, self)
  File "/Users/an/Desktop/vkquick/env/lib/python3.8/site-packages/clikit/api/command/command.py", line 35, in __init__
    self._args_format = config.build_args_format(self.base_format)
  File "/Users/an/Desktop/vkquick/env/lib/python3.8/site-packages/clikit/api/config/command_config.py", line 159, in build_args_format
    builder.add_options(*self.options.values())
  File "/Users/an/Desktop/vkquick/env/lib/python3.8/site-packages/clikit/api/args/format/args_format_builder.py", line 292, in add_options
    self.add_option(option)
  File "/Users/an/Desktop/vkquick/env/lib/python3.8/site-packages/clikit/api/args/format/args_format_builder.py", line 302, in add_option
    raise CannotAddOptionException.already_exists(short_name)
clikit.api.args.exceptions.CannotAddOptionException: An option named "-n" exists already.

There aren't any options with name n so I think it is a "built-in". Can I override it?

@samhocevar
Copy link

Same with -h, -q, -v and -V; it looks like the global options are copied to the commands…

@Secrus Secrus added this to the Future milestone Sep 5, 2022
@Secrus Secrus modified the milestones: Future, 3.0 Nov 28, 2024
@Secrus Secrus added the enhancement Improvement of an existing feature label Jan 3, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement Improvement of an existing feature
Projects
None yet
Development

No branches or pull requests

3 participants