Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Click argument error #18

Open
Spoons opened this issue Dec 9, 2021 · 1 comment
Open

Click argument error #18

Spoons opened this issue Dec 9, 2021 · 1 comment

Comments

@Spoons
Copy link

Spoons commented Dec 9, 2021

❯ ./topalias.sh
Traceback (most recent call last):
  File "/mnt/build/software/topalias/topalias/cli.py", line 167, in <module>
    sys.exit(cli())  # pragma: no cover # pylint: disable=no-value-for-parameter
  File "/usr/lib/python3.9/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/click/core.py", line 1052, in main
    with self.make_context(prog_name, args, **extra) as ctx:
  File "/usr/lib/python3.9/site-packages/click/core.py", line 914, in make_context
    self.parse_args(ctx, args)
  File "/usr/lib/python3.9/site-packages/click/core.py", line 1615, in parse_args
    rest = super().parse_args(ctx, args)
  File "/usr/lib/python3.9/site-packages/click/core.py", line 1370, in parse_args
    value, args = param.handle_parse_result(ctx, opts, args)
  File "/usr/lib/python3.9/site-packages/click/core.py", line 2347, in handle_parse_result
    value = self.process_value(ctx, value)
  File "/usr/lib/python3.9/site-packages/click/core.py", line 2309, in process_value
    value = self.callback(ctx, self, value)
TypeError: print_version() takes 2 positional arguments but 3 were given
Report you great ideas and any feedback: https://github.com/CSRedRat/topalias/issues/new

Cool project. Looks like the Click api use is incorrect or has changed. Also, I think you mean 'your great ideas'.

@ghost
Copy link

ghost commented Dec 18, 2021

It worked by downgrading click to 7.1.2

Here is what I did, using pipx
pipx runpip topalias install -U click==7.1.2

topalias -h
Usage: topalias [OPTIONS] COMMAND [ARGS]...

  See documentation and usage examples: https://csredrat.github.io/topalias

Options:
  -l, --min INTEGER     Print alias acronym not less that value. Default: 1
  -c, --count INTEGER   Print specified number acronym suggestions. Default:
                        20

  --filter              Filter used aliases in history. Default: False
  -z, --zsh             Use zsh shell history file .zsh_history. Default:
                        False

  -f, --path TEXT       Change custom directory for files: .bash_aliases,
                        .bash_history, .zsh_history

  --version             Print current program version and check latest on
                        pypi.org.

  --debug / --no-debug  Enable debug strings in output.
  -h, --help            Show this message and exit.

Commands:
  hint     Print all hints.
  history  Print bash history file.
  main     Main function for group command call.
  version  Get program current and available version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant