Skip to content

[Bug] wrong fish setup in config.fish #1737

Description

@ebauger

Hi,

I noticed that the current installation setup defaults to Bash completion. If sourced inside a Fish shell environment, the bash_completion.sh script causes syntax errors and fails to parse correctly.

I plan to submit a PR this week to add native Fish support.

Here is the draft of the implementation I am working on:

  1. Clean config.fish setup (removes bash dependency)
 . . . 
# OPS config
set -gx OPS_DIR "$HOME/.ops"
set -gx PATH "$HOME/.ops/bin" $PATH
  1. Proposed ops.fish completion script (To be placed in ~/.config/fish/completions/ops.fish)
# Disable file completions for the main command logic initially
complete -c ops -f

# 1. Define the main top-level commands
set -l ops_commands help build deploy image instance pkg profile run update version volume

# Add top-level completions
complete -c ops -n "not __fish_seen_subcommand_from $ops_commands" -a "$ops_commands"

# 2. Define Subcommands
complete -c ops -n "__fish_seen_subcommand_from pkg" -a "contents describe get list load"
complete -c ops -n "__fish_seen_subcommand_from instance" -a "create delete list logs start stop"
complete -c ops -n "__fish_seen_subcommand_from image" -a "create delete list resize sync"
complete -c ops -n "__fish_seen_subcommand_from volume" -a "attach create delete detach list"

Thx ✌️

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions