@shopify/cli-kit
    Preparing search index...

    Function portFlag

    • Builds a --port flag that only accepts a valid port number. The flag parses its value as an integer and rejects anything that isn't a whole number between 1 and 65535, so commands fail with a clear message instead of crashing on an out-of-range port. The accepted range is appended to the description so it shows up in --help.

      Parameters

      • options: { description?: string; env?: string; hidden?: boolean } = {}

        Optional overrides for the flag's description, environment variable, and visibility.

      Returns OptionFlag<number | undefined, CustomOptions>

      An oclif integer flag constrained to the valid port range.