Skip to content

Regression: -h alias not working #232

Closed

Description

@OrbisK

Environment

System:
OS: Linux 6.8 Ubuntu 24.04.3 LTS 24.04.3 LTS (Noble Numbat)
CPU: (2) x64 Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz
Memory: 5.15 GB / 7.76 GB
Container: Yes
Shell: 5.2.21 - /bin/bash
Binaries:
Node: 24.11.1 - /home/codespace/nvm/current/bin/node
Yarn: 1.22.22 - /usr/bin/yarn
npm: 11.6.2 - /home/codespace/nvm/current/bin/npm
pnpm: 10.30.3 - /home/codespace/nvm/current/bin/pnpm

Reproduction

nuxt/nuxt#34430

Describe the bug

With the newest version of citty it is not possible to use -h as an alias because it is reserved for --help.

If this is a wont fix, we should think about a warning to prevent the unexpected noop.

Additional context

No response

Logs

Activity

  1. added
    bug
    on Mar 13, 2026
  2. kricsleo commented on Mar 13, 2026

    @kricsleo
    Member

    Similar to the #145, could be resolved by #196.

  3. OrbisK commented on Mar 13, 2026

    @OrbisK
    ContributorAuthor

    Similar to the #145, could be resolved by #196.

    It is similar, but not the same 😅 for nuxt/cli we use nuxt dev -h 127.0.0.1 to override the host, not the help command. In this case --help should still work the same. (IMO)

    IMO aliasing h from any command should just fail/warn.

  4. kricsleo commented on Mar 14, 2026

    @kricsleo
    Member

    Similar to the #145, could be resolved by #196.

    Sorry for not making it clear 🙏. I meant they are similar in that the user wants to override built-in commands.
    You might want to check out #196. Would that work for you by allowing the override of built-in --help/-h and --version/-v?

  5. OrbisK commented on Mar 15, 2026

    @OrbisK
    ContributorAuthor

    Would that work for you by allowing the override of built-in --help/-h and --version/-v

    I think what I want is: If I set an -h alias to be either:

    1. it should not be allowed (warning or error)
    2. my alias should take priority (the --help should not be overriden)

    I really just want to use the alias, not override the help command 😅

  6. added 2 commits that reference this issue on Mar 15, 2026
    32c38e5
    b7225fd
  7. pi0 commented on Mar 15, 2026

    @pi0
    Member

    should be solved by #234

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions