diff --git a/alacritty.yml b/alacritty.yml new file mode 100644 index 0000000..2f0878a --- /dev/null +++ b/alacritty.yml @@ -0,0 +1,895 @@ +# Configuration for Alacritty, the GPU enhanced terminal emulator. + +# Import additional configuration files +# +# Imports are loaded in order, skipping all missing files, with the importing +# file being loaded last. If a field is already present in a previous import, it +# will be replaced. +# +# All imports must either be absolute paths starting with `/`, or paths relative +# to the user's home directory starting with `~/`. +#import: +# - /path/to/alacritty.yml + +# Any items in the `env` entry below will be added as +# environment variables. Some entries may override variables +# set by alacritty itself. +env: + # TERM variable + # + # This value is used to set the `$TERM` environment variable for + # each instance of Alacritty. If it is not present, alacritty will + # check the local terminfo database and use `alacritty` if it is + # available, otherwise `xterm-256color` is used. + TERM: alacritty + +window: + # Window dimensions (changes require restart) + # + # Number of lines/columns (not pixels) in the terminal. Both lines and columns + # must be non-zero for this to take effect. The number of columns must be at + # least `2`, while using a value of `0` for columns and lines will fall back + # to the window manager's recommended size + #dimensions: + #columns: 0 + #lines: 0 + + # Window position (changes require restart) + # + # Specified in number of pixels. + # If the position is not set, the window manager will handle the placement. + #position: + # x: 0 + # y: 0 + + # Window padding (changes require restart) + # + # Blank space added around the window in pixels. This padding is scaled + # by DPI and the specified value is always added at both opposing sides. + #padding: + # x: 0 + # y: 0 + + # Spread additional padding evenly around the terminal content. + # dynamic_padding: true + + # Window decorations + # + # Values for `decorations`: + # - full: Borders and title bar + # - none: Neither borders nor title bar + # + # Values for `decorations` (macOS only): + # - transparent: Title bar, transparent background and title bar buttons + # - buttonless: Title bar, transparent background and no title bar buttons + decorations: none + + # Background opacity + # + # Window opacity as a floating point number from `0.0` to `1.0`. + # The value `0.0` is completely transparent and `1.0` is opaque. + #opacity: 1.0 + + # Startup Mode (changes require restart) + # + # Values for `startup_mode`: + # - Windowed + # - Maximized + # - Fullscreen + # + # Values for `startup_mode` (macOS only): + # - SimpleFullscreen + #startup_mode: Windowed + + # Window title + title: "早上好中國,我很喜歡冰淇淋" + + # Allow terminal applications to change Alacritty's window title. + dynamic_title: true + + # Window class (Linux/BSD only): + #class: + # Application instance name + #instance: Alacritty + # General application class + #general: Alacritty + + # Decorations theme variant (Linux/BSD only) + # + # Override the variant of the GTK theme/Wayland client side decorations. + # Commonly supported values are `dark` and `light`. Set this to `None` to use + # the default theme variant. + #decorations_theme_variant: None + +#scrolling: + # Maximum number of lines in the scrollback buffer. + # Specifying '0' will disable scrolling. + #history: 10000 + + # Scrolling distance multiplier. + #multiplier: 3 + +# Font configuration +font: + # Normal (roman) font face + normal: + # Font family + # + # Default: + # - (macOS) Menlo + # - (Linux/BSD) monospace + # - (Windows) Consolas + family: "Hack Nerd Font Mono" + + # The `style` can be specified to pick a specific face. + #style: Regular + + # Bold font face + bold: + # Font family + # + # If the bold family is not specified, it will fall back to the + # value specified for the normal font. + family: "Hack Nerd Font Mono" + + # The `style` can be specified to pick a specific face. + style: Bold + + # Italic font face + italic: + # Font family + # + # If the italic family is not specified, it will fall back to the + # value specified for the normal font. + family: "Hack Nerd Font Mono" + + # The `style` can be specified to pick a specific face. + style: Italic + + # Bold italic font face + bold_italic: + # Font family + # + # If the bold italic family is not specified, it will fall back to the + # value specified for the normal font. + family: "Hack Nerd Font Mono" + + # The `style` can be specified to pick a specific face. + style: Bold Italic + + # Point size + size: 13 + + # Offset is the extra space around each character. `offset.y` can be thought + # of as modifying the line spacing, and `offset.x` as modifying the letter + # spacing. + #offset: + # x: 0 + # y: 0 + + # Glyph offset determines the locations of the glyphs within their cells with + # the default being at the bottom. Increasing `x` moves the glyph to the + # right, increasing `y` moves the glyph upward. + #glyph_offset: + # x: 0 + # y: 0 + + # Use built-in font for box drawing characters. + # + # If `true`, Alacritty will use a custom built-in font for box drawing + # characters (Unicode points 2500 - 259f). + # + #builtin_box_drawing: true + +# If `true`, bold text is drawn using the bright color variants. +#draw_bold_text_with_bright_colors: false + +# Colors (Tomorrow Night) +#colors: + # Default colors + #primary: + # background: '#1d1f21' + # foreground: '#c5c8c6' + + # Bright and dim foreground colors + # + # The dimmed foreground color is calculated automatically if it is not + # present. If the bright foreground color is not set, or + # `draw_bold_text_with_bright_colors` is `false`, the normal foreground + # color will be used. + #dim_foreground: '#828482' + #bright_foreground: '#eaeaea' + + # Cursor colors + # + # Colors which should be used to draw the terminal cursor. + # + # Allowed values are CellForeground/CellBackground, which reference the + # affected cell, or hexadecimal colors like #ff00ff. + #cursor: + # text: CellBackground + # cursor: CellForeground + + # Vi mode cursor colors + # + # Colors for the cursor when the vi mode is active. + # + # Allowed values are CellForeground/CellBackground, which reference the + # affected cell, or hexadecimal colors like #ff00ff. + #vi_mode_cursor: + # text: CellBackground + # cursor: CellForeground + + # Search colors + # + # Colors used for the search bar and match highlighting. + #search: + # Allowed values are CellForeground/CellBackground, which reference the + # affected cell, or hexadecimal colors like #ff00ff. + #matches: + # foreground: '#000000' + # background: '#ffffff' + #focused_match: + # foreground: '#ffffff' + # background: '#000000' + + # Keyboard hints + #hints: + # First character in the hint label + # + # Allowed values are CellForeground/CellBackground, which reference the + # affected cell, or hexadecimal colors like #ff00ff. + #start: + # foreground: '#1d1f21' + # background: '#e9ff5e' + + # All characters after the first one in the hint label + # + # Allowed values are CellForeground/CellBackground, which reference the + # affected cell, or hexadecimal colors like #ff00ff. + #end: + # foreground: '#e9ff5e' + # background: '#1d1f21' + + # Line indicator + # + # Color used for the indicator displaying the position in history during + # search and vi mode. + # + # By default, these will use the opposing primary color. + #line_indicator: + # foreground: None + # background: None + + # Footer bar + # + # Color used for the footer bar on the bottom, used by search regex input, + # hyperlink URI preview, etc. + # + #footer_bar: + # background: '#c5c8c6' + # foreground: '#1d1f21' + + # Selection colors + # + # Colors which should be used to draw the selection area. + # + # Allowed values are CellForeground/CellBackground, which reference the + # affected cell, or hexadecimal colors like #ff00ff. + #selection: + # text: CellBackground + # background: CellForeground + + # Normal colors + #normal: + # black: '#1d1f21' + # red: '#cc6666' + # green: '#b5bd68' + # yellow: '#f0c674' + # blue: '#81a2be' + # magenta: '#b294bb' + # cyan: '#8abeb7' + # white: '#c5c8c6' + + # Bright colors + #bright: + # black: '#666666' + # red: '#d54e53' + # green: '#b9ca4a' + # yellow: '#e7c547' + # blue: '#7aa6da' + # magenta: '#c397d8' + # cyan: '#70c0b1' + # white: '#eaeaea' + + # Dim colors + # + # If the dim colors are not set, they will be calculated automatically based + # on the `normal` colors. + #dim: + # black: '#131415' + # red: '#864343' + # green: '#777c44' + # yellow: '#9e824c' + # blue: '#556a7d' + # magenta: '#75617b' + # cyan: '#5b7d78' + # white: '#828482' + + # Indexed Colors + # + # The indexed colors include all colors from 16 to 256. + # When these are not set, they're filled with sensible defaults. + # + # Example: + # `- { index: 16, color: '#ff00ff' }` + # + #indexed_colors: [] + + # Transparent cell backgrounds + # + # Whether or not `window.opacity` applies to all cell backgrounds or only to + # the default background. When set to `true` all cells will be transparent + # regardless of their background color. + #transparent_background_colors: false + +# Bell +# +# The bell is rung every time the BEL control character is received. +#bell: + # Visual Bell Animation + # + # Animation effect for flashing the screen when the visual bell is rung. + # + # Values for `animation`: + # - Ease + # - EaseOut + # - EaseOutSine + # - EaseOutQuad + # - EaseOutCubic + # - EaseOutQuart + # - EaseOutQuint + # - EaseOutExpo + # - EaseOutCirc + # - Linear + #animation: EaseOutExpo + + # Duration of the visual bell flash in milliseconds. A `duration` of `0` will + # disable the visual bell animation. + #duration: 0 + + # Visual bell animation color. + #color: '#ffffff' + + # Bell Command + # + # This program is executed whenever the bell is rung. + # + # When set to `command: None`, no command will be executed. + # + # Example: + # command: + # program: notify-send + # args: ["Hello, World!"] + # + #command: None + +#selection: + # This string contains all characters that are used as separators for + # "semantic words" in Alacritty. + #semantic_escape_chars: ",│`|:\"' ()[]{}<>\t" + + # When set to `true`, selected text will be copied to the primary clipboard. + #save_to_clipboard: false + +#cursor: + # Cursor style + #style: + # Cursor shape + # + # Values for `shape`: + # - ▇ Block + # - _ Underline + # - | Beam + #shape: Block + + # Cursor blinking state + # + # Values for `blinking`: + # - Never: Prevent the cursor from ever blinking + # - Off: Disable blinking by default + # - On: Enable blinking by default + # - Always: Force the cursor to always blink + #blinking: Off + + # Vi mode cursor style + # + # If the vi mode cursor style is `None` or not specified, it will fall back to + # the style of the active value of the normal cursor. + # + # See `cursor.style` for available options. + #vi_mode_style: None + + # Cursor blinking interval in milliseconds. + #blink_interval: 750 + + # Time after which cursor stops blinking, in seconds. + # + # Specifying '0' will disable timeout for blinking. + #blink_timeout: 5 + + # If this is `true`, the cursor will be rendered as a hollow box when the + # window is not focused. + #unfocused_hollow: true + + # Thickness of the cursor relative to the cell width as floating point number + # from `0.0` to `1.0`. + #thickness: 0.15 + +# Live config reload (changes require restart) +#live_config_reload: true + +# Shell +# +# You can set `shell.program` to the path of your favorite shell, e.g. +# `/bin/fish`. Entries in `shell.args` are passed unmodified as arguments to the +# shell. +# +# Default: +# - (Linux/BSD/macOS) `$SHELL` or the user's login shell, if `$SHELL` is unset +# - (Windows) powershell +#shell: +# program: /bin/bash +# args: +# - --login + +# Startup directory +# +# Directory the shell is started in. If this is unset, or `None`, the working +# directory of the parent process will be used. +#working_directory: None + +# Send ESC (\x1b) before characters when alt is pressed. +#alt_send_esc: true + +# Offer IPC using `alacritty msg` (unix only) +#ipc_socket: true + +#mouse: + # Click settings + # + # The `double_click` and `triple_click` settings control the time + # alacritty should wait for accepting multiple clicks as one double + # or triple click. + #double_click: { threshold: 300 } + #triple_click: { threshold: 300 } + + # If this is `true`, the cursor is temporarily hidden when typing. + #hide_when_typing: false + +# Hints +# +# Terminal hints can be used to find text or hyperlink in the visible part of +# the terminal and pipe it to other applications. +#hints: + # Keys used for the hint labels. + #alphabet: "jfkdls;ahgurieowpq" + + # List with all available hints + # + # Each hint must have any of `regex` or `hyperlinks` field and either an + # `action` or a `command` field. The fields `mouse`, `binding` and + # `post_processing` are optional. + # + # The `hyperlinks` option will cause OSC 8 escape sequence hyperlinks to be + # highlighted. + # + # The fields `command`, `binding.key`, `binding.mods`, `binding.mode` and + # `mouse.mods` accept the same values as they do in the `key_bindings` section. + # + # The `mouse.enabled` field controls if the hint should be underlined while + # the mouse with all `mouse.mods` keys held or the vi mode cursor is above it. + # + # If the `post_processing` field is set to `true`, heuristics will be used to + # shorten the match if there are characters likely not to be part of the hint + # (e.g. a trailing `.`). This is most useful for URIs and applies only to + # `regex` matches. + # + # Values for `action`: + # - Copy + # Copy the hint's text to the clipboard. + # - Paste + # Paste the hint's text to the terminal or search. + # - Select + # Select the hint's text. + # - MoveViModeCursor + # Move the vi mode cursor to the beginning of the hint. + #enabled: + # - regex: "(ipfs:|ipns:|magnet:|mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)\ + # [^\u0000-\u001F\u007F-\u009F<>\"\\s{-}\\^⟨⟩`]+" + # hyperlinks: true + # command: xdg-open + # post_processing: true + # mouse: + # enabled: true + # mods: None + # binding: + # key: U + # mods: Control|Shift + +# Mouse bindings +# +# Mouse bindings are specified as a list of objects, much like the key +# bindings further below. +# +# To trigger mouse bindings when an application running within Alacritty +# captures the mouse, the `Shift` modifier is automatically added as a +# requirement. +# +# Each mouse binding will specify a: +# +# - `mouse`: +# +# - Middle +# - Left +# - Right +# - Numeric identifier such as `5` +# +# - `action` (see key bindings for actions not exclusive to mouse mode) +# +# - Mouse exclusive actions: +# +# - ExpandSelection +# Expand the selection to the current mouse cursor location. +# +# And optionally: +# +# - `mods` (see key bindings) +#mouse_bindings: +# - { mouse: Right, action: ExpandSelection } +# - { mouse: Right, mods: Control, action: ExpandSelection } +# - { mouse: Middle, mode: ~Vi, action: PasteSelection } + +# Key bindings +# +# Key bindings are specified as a list of objects. For example, this is the +# default paste binding: +# +# `- { key: V, mods: Control|Shift, action: Paste }` +# +# Each key binding will specify a: +# +# - `key`: Identifier of the key pressed +# +# - A-Z +# - F1-F24 +# - Key0-Key9 +# +# A full list with available key codes can be found here: +# https://docs.rs/glutin/*/glutin/event/enum.VirtualKeyCode.html#variants +# +# Instead of using the name of the keys, the `key` field also supports using +# the scancode of the desired key. Scancodes have to be specified as a +# decimal number. This command will allow you to display the hex scancodes +# for certain keys: +# +# `showkey --scancodes`. +# +# Then exactly one of: +# +# - `chars`: Send a byte sequence to the running application +# +# The `chars` field writes the specified string to the terminal. This makes +# it possible to pass escape sequences. To find escape codes for bindings +# like `PageUp` (`"\x1b[5~"`), you can run the command `showkey -a` outside +# of tmux. Note that applications use terminfo to map escape sequences back +# to keys. It is therefore required to update the terminfo when changing an +# escape sequence. +# +# - `action`: Execute a predefined action +# +# - ToggleViMode +# - SearchForward +# Start searching toward the right of the search origin. +# - SearchBackward +# Start searching toward the left of the search origin. +# - Copy +# - Paste +# - IncreaseFontSize +# - DecreaseFontSize +# - ResetFontSize +# - ScrollPageUp +# - ScrollPageDown +# - ScrollHalfPageUp +# - ScrollHalfPageDown +# - ScrollLineUp +# - ScrollLineDown +# - ScrollToTop +# - ScrollToBottom +# - ClearHistory +# Remove the terminal's scrollback history. +# - Hide +# Hide the Alacritty window. +# - Minimize +# Minimize the Alacritty window. +# - Quit +# Quit Alacritty. +# - ToggleFullscreen +# - SpawnNewInstance +# Spawn a new instance of Alacritty. +# - CreateNewWindow +# Create a new Alacritty window from the current process. +# - ClearLogNotice +# Clear Alacritty's UI warning and error notice. +# - ClearSelection +# Remove the active selection. +# - ReceiveChar +# - None +# +# - Vi mode exclusive actions: +# +# - Open +# Perform the action of the first matching hint under the vi mode cursor +# with `mouse.enabled` set to `true`. +# - ToggleNormalSelection +# - ToggleLineSelection +# - ToggleBlockSelection +# - ToggleSemanticSelection +# Toggle semantic selection based on `selection.semantic_escape_chars`. +# - CenterAroundViCursor +# Center view around vi mode cursor +# +# - Vi mode exclusive cursor motion actions: +# +# - Up +# One line up. +# - Down +# One line down. +# - Left +# One character left. +# - Right +# One character right. +# - First +# First column, or beginning of the line when already at the first column. +# - Last +# Last column, or beginning of the line when already at the last column. +# - FirstOccupied +# First non-empty cell in this terminal row, or first non-empty cell of +# the line when already at the first cell of the row. +# - High +# Top of the screen. +# - Middle +# Center of the screen. +# - Low +# Bottom of the screen. +# - SemanticLeft +# Start of the previous semantically separated word. +# - SemanticRight +# Start of the next semantically separated word. +# - SemanticLeftEnd +# End of the previous semantically separated word. +# - SemanticRightEnd +# End of the next semantically separated word. +# - WordLeft +# Start of the previous whitespace separated word. +# - WordRight +# Start of the next whitespace separated word. +# - WordLeftEnd +# End of the previous whitespace separated word. +# - WordRightEnd +# End of the next whitespace separated word. +# - Bracket +# Character matching the bracket at the cursor's location. +# - SearchNext +# Beginning of the next match. +# - SearchPrevious +# Beginning of the previous match. +# - SearchStart +# Start of the match to the left of the vi mode cursor. +# - SearchEnd +# End of the match to the right of the vi mode cursor. +# +# - Search mode exclusive actions: +# - SearchFocusNext +# Move the focus to the next search match. +# - SearchFocusPrevious +# Move the focus to the previous search match. +# - SearchConfirm +# - SearchCancel +# - SearchClear +# Reset the search regex. +# - SearchDeleteWord +# Delete the last word in the search regex. +# - SearchHistoryPrevious +# Go to the previous regex in the search history. +# - SearchHistoryNext +# Go to the next regex in the search history. +# +# - macOS exclusive actions: +# - ToggleSimpleFullscreen +# Enter fullscreen without occupying another space. +# +# - Linux/BSD exclusive actions: +# +# - CopySelection +# Copy from the selection buffer. +# - PasteSelection +# Paste from the selection buffer. +# +# - `command`: Fork and execute a specified command plus arguments +# +# The `command` field must be a map containing a `program` string and an +# `args` array of command line parameter strings. For example: +# `{ program: "alacritty", args: ["-e", "vttest"] }` +# +# And optionally: +# +# - `mods`: Key modifiers to filter binding actions +# +# - Command +# - Control +# - Option +# - Super +# - Shift +# - Alt +# +# Multiple `mods` can be combined using `|` like this: +# `mods: Control|Shift`. +# Whitespace and capitalization are relevant and must match the example. +# +# - `mode`: Indicate a binding for only specific terminal reported modes +# +# This is mainly used to send applications the correct escape sequences +# when in different modes. +# +# - AppCursor +# - AppKeypad +# - Search +# - Alt +# - Vi +# +# A `~` operator can be used before a mode to apply the binding whenever +# the mode is *not* active, e.g. `~Alt`. +# +# Bindings are always filled by default, but will be replaced when a new +# binding with the same triggers is defined. To unset a default binding, it can +# be mapped to the `ReceiveChar` action. Alternatively, you can use `None` for +# a no-op if you do not wish to receive input characters for that binding. +# +# If the same trigger is assigned to multiple actions, all of them are executed +# in the order they were defined in. +#key_bindings: + #- { key: Paste, action: Paste } + #- { key: Copy, action: Copy } + #- { key: L, mods: Control, action: ClearLogNotice } + #- { key: L, mods: Control, mode: ~Vi|~Search, chars: "\x0c" } + #- { key: PageUp, mods: Shift, mode: ~Alt, action: ScrollPageUp } + #- { key: PageDown, mods: Shift, mode: ~Alt, action: ScrollPageDown } + #- { key: Home, mods: Shift, mode: ~Alt, action: ScrollToTop } + #- { key: End, mods: Shift, mode: ~Alt, action: ScrollToBottom } + + # Vi Mode + #- { key: Space, mods: Shift|Control, mode: ~Search, action: ToggleViMode } + #- { key: Space, mods: Shift|Control, mode: Vi|~Search, action: ScrollToBottom } + #- { key: Escape, mode: Vi|~Search, action: ClearSelection } + #- { key: I, mode: Vi|~Search, action: ToggleViMode } + #- { key: I, mode: Vi|~Search, action: ScrollToBottom } + #- { key: C, mods: Control, mode: Vi|~Search, action: ToggleViMode } + #- { key: Y, mods: Control, mode: Vi|~Search, action: ScrollLineUp } + #- { key: E, mods: Control, mode: Vi|~Search, action: ScrollLineDown } + #- { key: G, mode: Vi|~Search, action: ScrollToTop } + #- { key: G, mods: Shift, mode: Vi|~Search, action: ScrollToBottom } + #- { key: B, mods: Control, mode: Vi|~Search, action: ScrollPageUp } + #- { key: F, mods: Control, mode: Vi|~Search, action: ScrollPageDown } + #- { key: U, mods: Control, mode: Vi|~Search, action: ScrollHalfPageUp } + #- { key: D, mods: Control, mode: Vi|~Search, action: ScrollHalfPageDown } + #- { key: Y, mode: Vi|~Search, action: Copy } + #- { key: Y, mode: Vi|~Search, action: ClearSelection } + #- { key: Copy, mode: Vi|~Search, action: ClearSelection } + #- { key: V, mode: Vi|~Search, action: ToggleNormalSelection } + #- { key: V, mods: Shift, mode: Vi|~Search, action: ToggleLineSelection } + #- { key: V, mods: Control, mode: Vi|~Search, action: ToggleBlockSelection } + #- { key: V, mods: Alt, mode: Vi|~Search, action: ToggleSemanticSelection } + #- { key: Return, mode: Vi|~Search, action: Open } + #- { key: Z, mode: Vi|~Search, action: CenterAroundViCursor } + #- { key: K, mode: Vi|~Search, action: Up } + #- { key: J, mode: Vi|~Search, action: Down } + #- { key: H, mode: Vi|~Search, action: Left } + #- { key: L, mode: Vi|~Search, action: Right } + #- { key: Up, mode: Vi|~Search, action: Up } + #- { key: Down, mode: Vi|~Search, action: Down } + #- { key: Left, mode: Vi|~Search, action: Left } + #- { key: Right, mode: Vi|~Search, action: Right } + #- { key: Key0, mode: Vi|~Search, action: First } + #- { key: Key4, mods: Shift, mode: Vi|~Search, action: Last } + #- { key: Key6, mods: Shift, mode: Vi|~Search, action: FirstOccupied } + #- { key: H, mods: Shift, mode: Vi|~Search, action: High } + #- { key: M, mods: Shift, mode: Vi|~Search, action: Middle } + #- { key: L, mods: Shift, mode: Vi|~Search, action: Low } + #- { key: B, mode: Vi|~Search, action: SemanticLeft } + #- { key: W, mode: Vi|~Search, action: SemanticRight } + #- { key: E, mode: Vi|~Search, action: SemanticRightEnd } + #- { key: B, mods: Shift, mode: Vi|~Search, action: WordLeft } + #- { key: W, mods: Shift, mode: Vi|~Search, action: WordRight } + #- { key: E, mods: Shift, mode: Vi|~Search, action: WordRightEnd } + #- { key: Key5, mods: Shift, mode: Vi|~Search, action: Bracket } + #- { key: Slash, mode: Vi|~Search, action: SearchForward } + #- { key: Slash, mods: Shift, mode: Vi|~Search, action: SearchBackward } + #- { key: N, mode: Vi|~Search, action: SearchNext } + #- { key: N, mods: Shift, mode: Vi|~Search, action: SearchPrevious } + + # Search Mode + #- { key: Return, mode: Search|Vi, action: SearchConfirm } + #- { key: Escape, mode: Search, action: SearchCancel } + #- { key: C, mods: Control, mode: Search, action: SearchCancel } + #- { key: U, mods: Control, mode: Search, action: SearchClear } + #- { key: W, mods: Control, mode: Search, action: SearchDeleteWord } + #- { key: P, mods: Control, mode: Search, action: SearchHistoryPrevious } + #- { key: N, mods: Control, mode: Search, action: SearchHistoryNext } + #- { key: Up, mode: Search, action: SearchHistoryPrevious } + #- { key: Down, mode: Search, action: SearchHistoryNext } + #- { key: Return, mode: Search|~Vi, action: SearchFocusNext } + #- { key: Return, mods: Shift, mode: Search|~Vi, action: SearchFocusPrevious } + + # (Windows, Linux, and BSD only) + #- { key: V, mods: Control|Shift, mode: ~Vi, action: Paste } + #- { key: C, mods: Control|Shift, action: Copy } + #- { key: F, mods: Control|Shift, mode: ~Search, action: SearchForward } + #- { key: B, mods: Control|Shift, mode: ~Search, action: SearchBackward } + #- { key: C, mods: Control|Shift, mode: Vi|~Search, action: ClearSelection } + #- { key: Insert, mods: Shift, action: PasteSelection } + #- { key: Key0, mods: Control, action: ResetFontSize } + #- { key: Equals, mods: Control, action: IncreaseFontSize } + #- { key: Plus, mods: Control, action: IncreaseFontSize } + #- { key: NumpadAdd, mods: Control, action: IncreaseFontSize } + #- { key: Minus, mods: Control, action: DecreaseFontSize } + #- { key: NumpadSubtract, mods: Control, action: DecreaseFontSize } + + # (Windows only) + #- { key: Return, mods: Alt, action: ToggleFullscreen } + + # (macOS only) + #- { key: K, mods: Command, mode: ~Vi|~Search, chars: "\x0c" } + #- { key: K, mods: Command, mode: ~Vi|~Search, action: ClearHistory } + #- { key: Key0, mods: Command, action: ResetFontSize } + #- { key: Equals, mods: Command, action: IncreaseFontSize } + #- { key: Plus, mods: Command, action: IncreaseFontSize } + #- { key: NumpadAdd, mods: Command, action: IncreaseFontSize } + #- { key: Minus, mods: Command, action: DecreaseFontSize } + #- { key: NumpadSubtract, mods: Command, action: DecreaseFontSize } + #- { key: V, mods: Command, action: Paste } + #- { key: C, mods: Command, action: Copy } + #- { key: C, mods: Command, mode: Vi|~Search, action: ClearSelection } + #- { key: H, mods: Command, action: Hide } + #- { key: H, mods: Command|Alt, action: HideOtherApplications } + #- { key: M, mods: Command, action: Minimize } + #- { key: Q, mods: Command, action: Quit } + #- { key: W, mods: Command, action: Quit } + #- { key: N, mods: Command, action: SpawnNewInstance } + #- { key: F, mods: Command|Control, action: ToggleFullscreen } + #- { key: F, mods: Command, mode: ~Search, action: SearchForward } + #- { key: B, mods: Command, mode: ~Search, action: SearchBackward } + +#debug: + # Display the time it takes to redraw each frame. + #render_timer: false + + # Keep the log file after quitting Alacritty. + #persistent_logging: false + + # Log level + # + # Values for `log_level`: + # - Off + # - Error + # - Warn + # - Info + # - Debug + # - Trace + #log_level: Warn + + # Print all received window events. + #print_events: false + + # Highlight window damage information. + #highlight_damage: false diff --git a/coc-settings.json b/coc-settings.json new file mode 100644 index 0000000..91aa85f --- /dev/null +++ b/coc-settings.json @@ -0,0 +1,39 @@ +{ + "diagnostic.checkCurrentLine": true, + "eslint.autoFixOnSave": false, + "eslint.filetypes": ["javascript", "javascriptreact", "typescript", "typescriptreact"], + "prettier.disableSuccessMessage": true, + "coc.preferences.diagnostic.virtualText": true, + "coc.preferences.formatOnSaveFiletypes": [ + "javascript", + "javascriptreact", + "typescript", + "typescriptreact", + "tf", + "ts", + "terraform", + "go" + ], + "tsserver.formatOnType": false, + "coc.preferences.formatOnType": false, + "languageserver": { + "terraform": { + "command": "terraform-ls", + "args": ["serve"], + "filetypes": [ + "terraform", + "tf" + ], + "initializationOptions": {}, + "settings": {} + }, + "golang": { + "command": "gopls", + "rootPatterns":["go.mod"], + "filetypes":["go"] + } + }, + "yaml.schemas": { + "kubernetes": "/*.yaml" + } +} diff --git a/fish/completions/alacritty.fish b/fish/completions/alacritty.fish new file mode 100644 index 0000000..fdc24ab --- /dev/null +++ b/fish/completions/alacritty.fish @@ -0,0 +1,31 @@ +complete -c alacritty -n "__fish_use_subcommand" -l embed -d 'X11 window ID to embed Alacritty within (decimal or hexadecimal with "0x" prefix)' -r +complete -c alacritty -n "__fish_use_subcommand" -l config-file -d 'Specify alternative configuration file [default: $XDG_CONFIG_HOME/alacritty/alacritty.yml]' -r -F +complete -c alacritty -n "__fish_use_subcommand" -l socket -d 'Path for IPC socket creation' -r -F +complete -c alacritty -n "__fish_use_subcommand" -s o -l option -d 'Override configuration file options [example: cursor.style=Beam]' -r +complete -c alacritty -n "__fish_use_subcommand" -l working-directory -d 'Start the shell in the specified working directory' -r -F +complete -c alacritty -n "__fish_use_subcommand" -s e -l command -d 'Command and args to execute (must be last argument)' -r +complete -c alacritty -n "__fish_use_subcommand" -s t -l title -d 'Defines the window title [default: Alacritty]' -r +complete -c alacritty -n "__fish_use_subcommand" -l class -d 'Defines window class/app_id on X11/Wayland [default: Alacritty]' -r +complete -c alacritty -n "__fish_use_subcommand" -s h -l help -d 'Print help information' +complete -c alacritty -n "__fish_use_subcommand" -s V -l version -d 'Print version information' +complete -c alacritty -n "__fish_use_subcommand" -l print-events -d 'Print all events to stdout' +complete -c alacritty -n "__fish_use_subcommand" -l ref-test -d 'Generates ref test' +complete -c alacritty -n "__fish_use_subcommand" -s q -d 'Reduces the level of verbosity (the min level is -qq)' +complete -c alacritty -n "__fish_use_subcommand" -s v -d 'Increases the level of verbosity (the max level is -vvv)' +complete -c alacritty -n "__fish_use_subcommand" -l hold -d 'Remain open after child process exit' +complete -c alacritty -n "__fish_use_subcommand" -f -a "msg" -d 'Send a message to the Alacritty socket' +complete -c alacritty -n "__fish_use_subcommand" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' +complete -c alacritty -n "__fish_seen_subcommand_from msg; and not __fish_seen_subcommand_from create-window; and not __fish_seen_subcommand_from config; and not __fish_seen_subcommand_from help" -s s -l socket -d 'IPC socket connection path override' -r -F +complete -c alacritty -n "__fish_seen_subcommand_from msg; and not __fish_seen_subcommand_from create-window; and not __fish_seen_subcommand_from config; and not __fish_seen_subcommand_from help" -s h -l help -d 'Print help information' +complete -c alacritty -n "__fish_seen_subcommand_from msg; and not __fish_seen_subcommand_from create-window; and not __fish_seen_subcommand_from config; and not __fish_seen_subcommand_from help" -f -a "create-window" -d 'Create a new window in the same Alacritty process' +complete -c alacritty -n "__fish_seen_subcommand_from msg; and not __fish_seen_subcommand_from create-window; and not __fish_seen_subcommand_from config; and not __fish_seen_subcommand_from help" -f -a "config" -d 'Update the Alacritty configuration' +complete -c alacritty -n "__fish_seen_subcommand_from msg; and not __fish_seen_subcommand_from create-window; and not __fish_seen_subcommand_from config; and not __fish_seen_subcommand_from help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' +complete -c alacritty -n "__fish_seen_subcommand_from msg; and __fish_seen_subcommand_from create-window" -l working-directory -d 'Start the shell in the specified working directory' -r -F +complete -c alacritty -n "__fish_seen_subcommand_from msg; and __fish_seen_subcommand_from create-window" -s e -l command -d 'Command and args to execute (must be last argument)' -r +complete -c alacritty -n "__fish_seen_subcommand_from msg; and __fish_seen_subcommand_from create-window" -s t -l title -d 'Defines the window title [default: Alacritty]' -r +complete -c alacritty -n "__fish_seen_subcommand_from msg; and __fish_seen_subcommand_from create-window" -l class -d 'Defines window class/app_id on X11/Wayland [default: Alacritty]' -r +complete -c alacritty -n "__fish_seen_subcommand_from msg; and __fish_seen_subcommand_from create-window" -l hold -d 'Remain open after child process exit' +complete -c alacritty -n "__fish_seen_subcommand_from msg; and __fish_seen_subcommand_from create-window" -s h -l help -d 'Print help information' +complete -c alacritty -n "__fish_seen_subcommand_from msg; and __fish_seen_subcommand_from config" -s w -l window-id -d 'Window ID for the new config' -r +complete -c alacritty -n "__fish_seen_subcommand_from msg; and __fish_seen_subcommand_from config" -s r -l reset -d 'Clear all runtime configuration changes' +complete -c alacritty -n "__fish_seen_subcommand_from msg; and __fish_seen_subcommand_from config" -s h -l help -d 'Print help information' diff --git a/fish/completions/docker.fish b/fish/completions/docker.fish new file mode 100644 index 0000000..4198474 --- /dev/null +++ b/fish/completions/docker.fish @@ -0,0 +1,586 @@ +# docker.fish - docker completions for fish shell +# +# This file is generated by gen_docker_fish_completions.py from: +# https://github.com/barnybug/docker-fish-completion +# +# To install the completions: +# mkdir -p ~/.config/fish/completions +# cp docker.fish ~/.config/fish/completions +# +# Completion supported: +# - parameters +# - commands +# - containers +# - images +# - repositories + +function __fish_docker_no_subcommand --description 'Test if docker has yet to be given the subcommand' + for i in (commandline -opc) + if contains -- $i attach build commit cp create diff events exec export history images import info inspect kill load login logout logs network pause port ps pull push rename restart rm rmi run save search start stop tag top trust unpause version wait stats + return 1 + end + end + return 0 +end + +function __fish_print_docker_containers --description 'Print a list of docker containers' -a select + switch $select + case running + docker ps -a --no-trunc --filter status=running --format "{{.ID}}\n{{.Names}}" | tr ',' '\n' + case stopped + docker ps -a --no-trunc --filter status=exited --format "{{.ID}}\n{{.Names}}" | tr ',' '\n' + case all + docker ps -a --no-trunc --format "{{.ID}}\n{{.Names}}" | tr ',' '\n' + end +end + +function __fish_print_docker_networks --description 'Print a list of docker networks' + docker network ls --format "{{.ID}}\n{{.Name}}" | tr ',' '\n' +end + + +function __fish_docker_no_subcommand_trust --description 'Test if docker has yet to be given the trust subcommand' + if __fish_seen_subcommand_from trust + for i in (commandline -opc) + if contains -- $i inspect key revoke sign signer + return 1 + end + end + return 0 + end + return 1 +end + +function __fish_docker_subcommand_path --description 'Test if command has all arguments in any order' + set -l cmd (commandline -poc) + set -e cmd[1] + for sub in $argv + if not contains -- $sub $cmd + return 1 + end + end + return 0 +end + +function __fish_docker_subcommand_path_without --description 'Test if command has all arguments in any order' + set -l cmd (commandline -poc) + set -e cmd[1] + for sub in $argv + if contains -- $sub $cmd + return 1 + end + end + return 0 +end + +function __fish_print_docker_images --description 'Print a list of docker images' + docker images --format "{{.Repository}}:{{.Tag}}" | command grep -v '' +end + +function __fish_print_docker_repositories --description 'Print a list of docker repositories' + docker images --format "{{.Repository}}" | command grep -v '' | command sort | command uniq +end + +# common options +complete -c docker -f -n '__fish_docker_no_subcommand' -l api-cors-header -d "Set CORS headers in the Engine API. Default is cors disabled" +complete -c docker -f -n '__fish_docker_no_subcommand' -s b -l bridge -d 'Attach containers to a pre-existing network bridge' +complete -c docker -f -n '__fish_docker_no_subcommand' -l bip -d "Use this CIDR notation address for the network bridge's IP, not compatible with -b" +complete -c docker -f -n '__fish_docker_no_subcommand' -s D -l debug -d 'Enable debug mode' +complete -c docker -f -n '__fish_docker_no_subcommand' -s d -l daemon -d 'Enable daemon mode' +complete -c docker -f -n '__fish_docker_no_subcommand' -l dns -d 'Force Docker to use specific DNS servers' +complete -c docker -f -n '__fish_docker_no_subcommand' -l dns-opt -d 'Force Docker to use specific DNS options' +complete -c docker -f -n '__fish_docker_no_subcommand' -l dns-search -d 'Force Docker to use specific DNS search domains' +complete -c docker -f -n '__fish_docker_no_subcommand' -l exec-opt -d 'Set runtime execution options' +complete -c docker -f -n '__fish_docker_no_subcommand' -l fixed-cidr -d 'IPv4 subnet for fixed IPs (e.g. 10.20.0.0/16)' +complete -c docker -f -n '__fish_docker_no_subcommand' -l fixed-cidr-v6 -d 'IPv6 subnet for fixed IPs (e.g.: 2001:a02b/48)' +complete -c docker -f -n '__fish_docker_no_subcommand' -s G -l group -d 'Group to assign the unix socket specified by -H when running in daemon mode' +complete -c docker -f -n '__fish_docker_no_subcommand' -s g -l graph -d 'Path to use as the root of the Docker runtime' +complete -c docker -f -n '__fish_docker_no_subcommand' -s H -l host -d 'The socket(s) to bind to in daemon mode or connect to in client mode, specified using one or more tcp://host:port, unix:///path/to/socket, fd://* or fd://socketfd.' +complete -c docker -f -n '__fish_docker_no_subcommand' -s h -l help -d 'Print usage' +complete -c docker -f -n '__fish_docker_no_subcommand' -l icc -d 'Allow unrestricted inter-container and Docker daemon host communication' +complete -c docker -f -n '__fish_docker_no_subcommand' -l insecure-registry -d 'Enable insecure communication with specified registries (no certificate verification for HTTPS and enable HTTP fallback) (e.g., localhost:5000 or 10.20.0.0/16)' +complete -c docker -f -n '__fish_docker_no_subcommand' -l ip -d 'Default IP address to use when binding container ports' +complete -c docker -f -n '__fish_docker_no_subcommand' -l ip-forward -d 'Enable net.ipv4.ip_forward and IPv6 forwarding if --fixed-cidr-v6 is defined. IPv6 forwarding may interfere with your existing IPv6 configuration when using Router Advertisement.' +complete -c docker -f -n '__fish_docker_no_subcommand' -l ip-masq -d "Enable IP masquerading for bridge's IP range" +complete -c docker -f -n '__fish_docker_no_subcommand' -l iptables -d "Enable Docker's addition of iptables rules" +complete -c docker -f -n '__fish_docker_no_subcommand' -l ipv6 -d 'Enable IPv6 networking' +complete -c docker -f -n '__fish_docker_no_subcommand' -s l -l log-level -d 'Set the logging level ("debug", "info", "warn", "error", "fatal")' +complete -c docker -f -n '__fish_docker_no_subcommand' -l label -d 'Set key=value labels to the daemon (displayed in `docker info`)' +complete -c docker -f -n '__fish_docker_no_subcommand' -l mtu -d 'Set the containers network MTU' +complete -c docker -f -n '__fish_docker_no_subcommand' -s p -l pidfile -d 'Path to use for daemon PID file' +complete -c docker -f -n '__fish_docker_no_subcommand' -l registry-mirror -d 'Specify a preferred Docker registry mirror' +complete -c docker -f -n '__fish_docker_no_subcommand' -s s -l storage-driver -d 'Force the Docker runtime to use a specific storage driver' +complete -c docker -f -n '__fish_docker_no_subcommand' -l selinux-enabled -d 'Enable selinux support. SELinux does not presently support the BTRFS storage driver' +complete -c docker -f -n '__fish_docker_no_subcommand' -l storage-opt -d 'Set storage driver options' +complete -c docker -f -n '__fish_docker_no_subcommand' -l tls -d 'Use TLS; implied by --tlsverify' +complete -c docker -f -n '__fish_docker_no_subcommand' -l tlscacert -d 'Trust only remotes providing a certificate signed by the CA given here' +complete -c docker -f -n '__fish_docker_no_subcommand' -l tlscert -d 'Path to TLS certificate file' +complete -c docker -f -n '__fish_docker_no_subcommand' -l tlskey -d 'Path to TLS key file' +complete -c docker -f -n '__fish_docker_no_subcommand' -l tlsverify -d 'Use TLS and verify the remote (daemon: verify client, client: verify daemon)' +complete -c docker -f -n '__fish_docker_no_subcommand' -s v -l version -d 'Print version information and quit' + +# subcommands +# attach +complete -c docker -f -n '__fish_docker_no_subcommand' -a attach -d 'Attach local standard input, output, and error streams to a running container' +complete -c docker -A -f -n '__fish_seen_subcommand_from attach' -l detach-keys -d 'Override the key sequence for detaching a container' +complete -c docker -A -f -n '__fish_seen_subcommand_from attach' -l help -d 'Print usage' +complete -c docker -A -f -n '__fish_seen_subcommand_from attach' -l no-stdin -d 'Do not attach STDIN' +complete -c docker -A -f -n '__fish_seen_subcommand_from attach' -l sig-proxy -d 'Proxy all received signals to the process' +complete -c docker -A -f -n '__fish_seen_subcommand_from attach' -a '(__fish_print_docker_containers running)' -d "Container" + +# build +complete -c docker -f -n '__fish_docker_no_subcommand' -a build -d 'Build an image from a Dockerfile' +complete -c docker -A -f -n '__fish_seen_subcommand_from build' -l add-host -d 'Add a custom host-to-IP mapping (host:ip)' +complete -c docker -A -f -n '__fish_seen_subcommand_from build' -l build-arg -d 'Set build-time variables' +complete -c docker -A -f -n '__fish_seen_subcommand_from build' -l cache-from -d 'Images to consider as cache sources' +complete -c docker -A -f -n '__fish_seen_subcommand_from build' -l cgroup-parent -d 'Optional parent cgroup for the container' +complete -c docker -A -f -n '__fish_seen_subcommand_from build' -l compress -d 'Compress the build context using gzip' +complete -c docker -A -f -n '__fish_seen_subcommand_from build' -l cpu-period -d 'Limit the CPU CFS (Completely Fair Scheduler) period' +complete -c docker -A -f -n '__fish_seen_subcommand_from build' -l cpu-quota -d 'Limit the CPU CFS (Completely Fair Scheduler) quota' +complete -c docker -A -f -n '__fish_seen_subcommand_from build' -s c -l cpu-shares -d 'CPU shares (relative weight)' +complete -c docker -A -f -n '__fish_seen_subcommand_from build' -l cpuset-cpus -d 'CPUs in which to allow execution (0-3, 0,1)' +complete -c docker -A -f -n '__fish_seen_subcommand_from build' -l cpuset-mems -d 'MEMs in which to allow execution (0-3, 0,1)' +complete -c docker -A -f -n '__fish_seen_subcommand_from build' -l disable-content-trust -d 'Skip image verification' +complete -c docker -A -f -n '__fish_seen_subcommand_from build' -s f -l file -d "Name of the Dockerfile (Default is ‘PATH/Dockerfile’)" +complete -c docker -A -f -n '__fish_seen_subcommand_from build' -l force-rm -d 'Always remove intermediate containers' +complete -c docker -A -f -n '__fish_seen_subcommand_from build' -l help -d 'Print usage' +complete -c docker -A -f -n '__fish_seen_subcommand_from build' -l iddfile -d 'Write the image ID to the file' +complete -c docker -A -f -n '__fish_seen_subcommand_from build' -l isolation -d 'Container isolation technology' +complete -c docker -A -f -n '__fish_seen_subcommand_from build' -l label -d 'Set metadata for an image' +complete -c docker -A -f -n '__fish_seen_subcommand_from build' -s m -l memory -d 'Memory limit' +complete -c docker -A -f -n '__fish_seen_subcommand_from build' -l memory-swap -d 'Swap limit equal to memory plus swap: ‘-1’ to enable unlimited swap' +complete -c docker -A -f -n '__fish_seen_subcommand_from build' -l network -d 'Set the networking mode for the RUN instructions during build' +complete -c docker -A -f -n '__fish_seen_subcommand_from build' -l no-cache -d 'Do not use cache when building the image' +complete -c docker -A -f -n '__fish_seen_subcommand_from build' -l pull -d 'Always attempt to pull a newer version of the image' +complete -c docker -A -f -n '__fish_seen_subcommand_from build' -s q -l quiet -d 'Suppress the build output and print image ID on success' +complete -c docker -A -f -n '__fish_seen_subcommand_from build' -l rm -d 'Remove intermediate containers after a successful build' +complete -c docker -A -f -n '__fish_seen_subcommand_from build' -l security-opt -d 'Security options' +complete -c docker -A -f -n '__fish_seen_subcommand_from build' -l shm-size -d 'Size of /dev/shm' +complete -c docker -A -f -n '__fish_seen_subcommand_from build' -s t -l tag -d 'Name and optionally a tag in the ‘name:tag’ format' +complete -c docker -A -f -n '__fish_seen_subcommand_from build' -l target -d 'Set the target build stage to build' +complete -c docker -A -f -n '__fish_seen_subcommand_from build' -l ulimit -d 'Ulimit options' + +# commit +complete -c docker -f -n '__fish_docker_no_subcommand' -a commit -d "Create a new image from a container's changes" +complete -c docker -A -f -n '__fish_seen_subcommand_from commit' -s a -l author -d 'Author (e.g., "John Hannibal Smith ")' +complete -c docker -A -f -n '__fish_seen_subcommand_from commit' -s c -l change -d 'Apply Dockerfile instruction to the created image' +complete -c docker -A -f -n '__fish_seen_subcommand_from commit' -l help -d 'Print usage' +complete -c docker -A -f -n '__fish_seen_subcommand_from commit' -s m -l message -d 'Commit message' +complete -c docker -A -f -n '__fish_seen_subcommand_from commit' -s p -l pause -d 'Pause container during commit' +complete -c docker -A -f -n '__fish_seen_subcommand_from commit' -a '(__fish_print_docker_containers all)' -d "Container" + +# cp +complete -c docker -f -n '__fish_docker_no_subcommand' -a cp -d "Copy files/folders between a container and the local filesystem" +complete -c docker -A -f -n '__fish_seen_subcommand_from cp' -s a -l archive -d 'Archive mode (copy all uid/gid information)' +complete -c docker -A -f -n '__fish_seen_subcommand_from cp' -s L -l follow-link -d 'Always follow symbol link in SRC_PATH' +complete -c docker -A -f -n '__fish_seen_subcommand_from cp' -l help -d 'Print usage' + +# create +complete -c docker -f -n '__fish_docker_no_subcommand' -a create -d 'Create a new container' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l add-host -d 'Add a custom host-to-IP mapping (host:ip)' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -s a -l attach -d 'Attach to STDIN, STDOUT or STDERR.' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l blkio-weight -d 'Block IO (relative weight), between 10 and 1000, or 0 to disable (default 0)' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l blkio-weight-device -d 'Block IO weight (relative device weight)' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l cap-add -d 'Add Linux capabilities' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l cap-drop -d 'Drop Linux capabilities' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l cgroupns -d 'Cgroup namespace mode to use' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l cgroup-parent -d 'Optional parent cgroup for the container' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l cidfile -d 'Write the container ID to the file' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l cpu-count -d 'CPU count (Windows only)' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l cpu-percent -d 'CPU percent (Windows only)' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l cpu-period -d 'Limit CPU CFS (Completely Fair Scheduler) period' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l cpu-quota -d 'Limit CPU CFS (Completely Fair Scheduler) quota' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l cpu-rt-period -d 'Limit CPU real-time period in microseconds' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l cpu-rt-runtime -d 'Limit CPU real-time runtime in microseconds' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l cpu-shares -d 'CPU shares (relative weight)' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l cpus -d 'Number of CPUs' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l cpuset-cpus -d 'CPUs in which to allow execution (0-3, 0,1)' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l cpuset-mems -d 'MEMs in which to allow execution (0-3, 0,1)' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l device -d 'Add a host device to the container (e.g. --device=/dev/sdc:/dev/xvdc:rwm)' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l device-cgroup-rule -d 'Add a rule to the cgroup allowed devices list' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l device-read-bps -d 'Limit read rate (bytes per second) from a device' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l device-read-iops -d 'Limit read rate (IO per second) from a device' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l device-write-bps -d 'Limit write rate (bytes per second) to a device' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l device-write-iops -d 'Limit write rate (IO per second) to a device' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l disable-content-trust -d 'Skip image verification' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l dns -d 'Set custom DNS servers' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l dns-opt -d 'Set DNS options' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l dns-option -d 'Set DNS options' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l dns-search -d 'Set custom DNS search domains' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -s e -l env -d 'Set environment variables' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l entrypoint -d 'Overwrite the default ENTRYPOINT of the image' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l env-file -d 'Read in a line delimited file of environment variables' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l expose -d 'Expose a port or a range of ports' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l group-add -d 'Add additional groups to join' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l health-cmd -d 'Command to run to check health' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l health-interval -d 'Time between running the check (ms|s|m|h) (default 0s)' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l health-retries -d 'Consecutive failures needed to report unhealthy' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l health-start-period -d 'Start period for the container to initialize before starting health-retries countdown (ms|s|m|h) (default 0s)' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l health-timeout -d 'Maximum time to allow one check to run (ms|s|m|h) (default 0s)' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l help -d 'Print usage' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -s h -l hostname -d 'Container host name' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l init -d 'Run an init inside the container that forwards signals and reaps processes' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -s i -l interactive -d 'Keep STDIN open even if not attached' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l io-maxbandwidth -d 'Maximum IO bandwidth limit for the system drive (Windows only)' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l io-maxiops -d 'Maximum IOps limit for the system drive (Windows only)' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l ip -d 'IPv4 address (e.g., 172.30.100.104)' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l ip6 -d 'IPv6 address (e.g., 2001:db8::33)' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l ipc -d 'IPC mode to use' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l isolation -d 'Container isolation technology' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l kernel-memory -d 'Kernel memory limit' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -s l -l label -d 'Set meta data on a container' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l label-file -d 'Read in a line delimited file of labels' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l link -d 'Add link to another container' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l link-local-ip -d 'Container IPv4/IPv6 link-local addresses' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l log-driver -d 'Logging driver for the container' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l log-opt -d 'Log driver options' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l mac-address -d 'Container MAC address (e.g., 92:d0:c6:0a:29:33)' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -s m -l memory -d 'Memory limit' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l memory-reservation -d 'Memory soft limit' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l memory-swap -d 'Swap limit equal to memory plus swap: ‘-1’ to enable unlimited swap' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l memory-swappiness -d 'Tune container memory swappiness (0 to 100)' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l mount -d 'Attach a filesystem mount to the container' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l name -d 'Assign a name to the container' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -s net -l network -d 'Connect a container to a network' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -s net-alias -l network-alias -d 'Add network-scoped alias for the container' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l no-healthcheck -d 'Disable any container-specified HEALTHCHECK' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l oom-kill-disable -d 'Disable OOM Killer' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l oom-score-adj -d 'Tune host’s OOM preferences (-1000 to 1000)' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l pid -d 'PID namespace to use' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l pids-limit -d 'Tune container pids limit (set -1 for unlimited )' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l privileged -d 'Give extended privileges to this container' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -s p -l publish -d "Publish a container’s port(s) to the host" +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -s P -l publish-all -d 'Publish all exposed ports to random ports' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l read-only -d "Mount the container's root filesystem as read only" +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l restart -d 'Restart policy to apply when a container exits' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l rm -d 'Automatically remove the container when it exits' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l runtime -d 'Runtime to use for this container' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l security-opt -d 'Security Options' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l shm-size -d 'Size of /dev/shm' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l stop-signal -d 'Signal to stop a container' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l stop-timeout -d 'Timeout (in seconds) to stop a container' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l storage-opt -d 'Storage driver options for the container' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l sysctl -d 'Sysctl options' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l tmpfs -d 'Mount a tmpfs directory' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -s t -l tty -d 'Allocate a pseudo-TTY' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l ulimit -d 'Ulimit options' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -s u -l user -d ' Username or UID (format: [:])' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l userns -d 'User namespace to use' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l uts -d 'UTS namespace to use' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -s v -l volume -d 'Bind mount a volume' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l volume-driver -d 'Optional volume driver for the container' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l volumes-from -d 'Mount volumes from the specified container(s)' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -s w -l workdir -d 'Working directory inside the container' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -a '(__fish_print_docker_images)' -d "Image" + +# diff +complete -c docker -f -n '__fish_docker_no_subcommand' -a diff -d "Inspect changes on a container's filesystem" +complete -c docker -A -f -n '__fish_seen_subcommand_from diff' -l help -d 'Print usage' +complete -c docker -A -f -n '__fish_seen_subcommand_from diff' -a '(__fish_print_docker_containers all)' -d "Container" + +# events +complete -c docker -f -n '__fish_docker_no_subcommand' -a events -d 'Get real time events from the server' +complete -c docker -A -f -n '__fish_seen_subcommand_from events' -s f -l filter -d "Filter output based on conditions provided" +complete -c docker -A -f -n '__fish_seen_subcommand_from events' -l format -d 'Format the output using the given Go template' +complete -c docker -A -f -n '__fish_seen_subcommand_from events' -l help -d 'Print usage' +complete -c docker -A -f -n '__fish_seen_subcommand_from events' -l since -d 'Show all events created since timestamp' +complete -c docker -A -f -n '__fish_seen_subcommand_from events' -l until -d 'Stream events until this timestamp' + +# exec +complete -c docker -f -n '__fish_docker_no_subcommand' -a exec -d 'Run a command in a running container' +complete -c docker -A -f -n '__fish_seen_subcommand_from exec' -s d -l detach -d 'Detached mode: run command in the background' +complete -c docker -A -f -n '__fish_seen_subcommand_from exec' -l detach-keys -d 'Override the key sequence for detaching a container' +complete -c docker -A -f -n '__fish_seen_subcommand_from exec' -s e -l env -d 'Set environment variables' +complete -c docker -A -f -n '__fish_seen_subcommand_from exec' -l help -d 'Print usage' +complete -c docker -A -f -n '__fish_seen_subcommand_from exec' -s i -l interactive -d 'Keep STDIN open even if not attached' +complete -c docker -A -f -n '__fish_seen_subcommand_from exec' -l privileged -d 'Give extended privileges to the command' +complete -c docker -A -f -n '__fish_seen_subcommand_from exec' -s t -l tty -d 'Allocate a pseudo-TTY' +complete -c docker -A -f -n '__fish_seen_subcommand_from exec' -s u -l user -d 'Username or UID (format: [:])' +complete -c docker -A -f -n '__fish_seen_subcommand_from exec' -s w -l workdir -d 'Working directory inside the container' +complete -c docker -A -f -n '__fish_seen_subcommand_from exec' -a '(__fish_print_docker_containers running)' -d "Container" + +# export +complete -c docker -f -n '__fish_docker_no_subcommand' -a export -d 'Stream the contents of a container as a tar archive' +complete -c docker -A -f -n '__fish_seen_subcommand_from export' -l help -d 'Print usage' +complete -c docker -A -f -n '__fish_seen_subcommand_from export' -s o -l output -d 'Write to a file, instead of STDOUT' +complete -c docker -A -f -n '__fish_seen_subcommand_from export' -a '(__fish_print_docker_containers all)' -d "Container" + +# history +complete -c docker -f -n '__fish_docker_no_subcommand' -a history -d 'Show the history of an image' +complete -c docker -A -f -n '__fish_seen_subcommand_from history' -l format -d 'Pretty-print images using a Go template' +complete -c docker -A -f -n '__fish_seen_subcommand_from history' -l help -d 'Print usage' +complete -c docker -A -f -n '__fish_seen_subcommand_from history' -s H -l human -d 'Print sizes and dates in human readable format' +complete -c docker -A -f -n '__fish_seen_subcommand_from history' -l no-trunc -d "Don't truncate output" +complete -c docker -A -f -n '__fish_seen_subcommand_from history' -s q -l quiet -d 'Only show image IDs' +complete -c docker -A -f -n '__fish_seen_subcommand_from history' -a '(__fish_print_docker_images)' -d "Image" + +# images +complete -c docker -f -n '__fish_docker_no_subcommand' -a images -d 'List images' +complete -c docker -A -f -n '__fish_seen_subcommand_from images' -s a -l all -d 'Show all images (default hides intermediate images)' +complete -c docker -A -f -n '__fish_seen_subcommand_from images' -l digests -d 'Show digests' +complete -c docker -A -f -n '__fish_seen_subcommand_from images' -s f -l filter -d 'Filter output based on conditions provided' +complete -c docker -A -f -n '__fish_seen_subcommand_from images' -l format -d 'Pretty-print images using a Go template' +complete -c docker -A -f -n '__fish_seen_subcommand_from images' -l help -d 'Print usage' +complete -c docker -A -f -n '__fish_seen_subcommand_from images' -l no-trunc -d "Don't truncate output" +complete -c docker -A -f -n '__fish_seen_subcommand_from images' -s q -l quiet -d 'Only show image IDs' +complete -c docker -A -f -n '__fish_seen_subcommand_from images' -a '(__fish_print_docker_repositories)' -d "Repository" + +# import +complete -c docker -f -n '__fish_docker_no_subcommand' -a import -d 'Create a new filesystem image from the contents of a tarball' +complete -c docker -A -f -n '__fish_seen_subcommand_from import' -s c -l change -d 'Apply Dockerfile instruction to the created image' +complete -c docker -A -f -n '__fish_seen_subcommand_from import' -s m -l message -d 'Set commit message for imported image' +complete -c docker -A -f -n '__fish_seen_subcommand_from import' -l help -d 'Print usage' + +# info +complete -c docker -f -n '__fish_docker_no_subcommand' -a info -d 'Display system-wide information' +complete -c docker -A -f -n '__fish_seen_subcommand_from info' -s f -l format -d 'Format the output using the given go template' +complete -c docker -A -f -n '__fish_seen_subcommand_from info' -l help -d 'Print usage' + +# inspect +complete -c docker -f -n '__fish_docker_no_subcommand' -a inspect -d 'Return low-level information on a container or image' +complete -c docker -A -f -n '__fish_seen_subcommand_from inspect' -s f -l format -d 'Format the output using the given go template.' +complete -c docker -A -f -n '__fish_seen_subcommand_from inspect' -l help -d 'Print usage' +complete -c docker -A -f -n '__fish_seen_subcommand_from inspect' -s s -l size -d 'Display total file sizes if the type is container.' +complete -c docker -A -f -n '__fish_seen_subcommand_from inspect' -l type -d 'Return JSON for specified type' +complete -c docker -A -f -n '__fish_seen_subcommand_from inspect' -a '(__fish_print_docker_images)' -d "Image" +complete -c docker -A -f -n '__fish_seen_subcommand_from inspect' -a '(__fish_print_docker_containers all)' -d "Container" + +# kill +complete -c docker -f -n '__fish_docker_no_subcommand' -a kill -d 'Kill a running container' +complete -c docker -A -f -n '__fish_seen_subcommand_from kill' -l help -d 'Print usage' +complete -c docker -A -f -n '__fish_seen_subcommand_from kill' -s s -l signal -d 'Signal to send to the container' +complete -c docker -A -f -n '__fish_seen_subcommand_from kill' -a '(__fish_print_docker_containers running)' -d "Container" + +# load +complete -c docker -f -n '__fish_docker_no_subcommand' -a load -d 'Load an image from a tar archive' +complete -c docker -A -f -n '__fish_seen_subcommand_from load' -l help -d 'Print usage' +complete -c docker -A -f -n '__fish_seen_subcommand_from load' -s i -l input -d 'Read from a tar archive file, instead of STDIN' +complete -c docker -A -f -n '__fish_seen_subcommand_from load' -s q -l quiet -d 'Suppress the load output' + +# login +complete -c docker -f -n '__fish_docker_no_subcommand' -a login -d 'Log in to a Docker registry server' +complete -c docker -A -f -n '__fish_seen_subcommand_from login' -l help -d 'Print usage' +complete -c docker -A -f -n '__fish_seen_subcommand_from login' -s p -l password -d 'Password' +complete -c docker -A -f -n '__fish_seen_subcommand_from login' -l password-stdin -d 'Take the password from stdin' +complete -c docker -A -f -n '__fish_seen_subcommand_from login' -s u -l username -d 'Username' + +# logout +complete -c docker -f -n '__fish_docker_no_subcommand' -a logout -d 'Log out from a Docker registry server' + +# logs +complete -c docker -f -n '__fish_docker_no_subcommand' -a logs -d 'Fetch the logs of a container' +complete -c docker -A -f -n '__fish_seen_subcommand_from logs' -s f -l follow -d 'Follow log output' +complete -c docker -A -f -n '__fish_seen_subcommand_from logs' -l help -d 'Print usage' +complete -c docker -A -f -n '__fish_seen_subcommand_from logs' -s t -l timestamps -d 'Show timestamps' +complete -c docker -A -f -n '__fish_seen_subcommand_from logs' -l since -d 'Show logs since timestamp' +complete -c docker -A -f -n '__fish_seen_subcommand_from logs' -s n -l tail -d 'Output the specified number of lines at the end of logs (defaults to all logs)' +complete -c docker -A -f -n '__fish_seen_subcommand_from logs' -a '(__fish_print_docker_containers running)' -d "Container" + +# network +complete -c docker -f -n '__fish_docker_no_subcommand' -a network -d 'Manage networks' +complete -c docker -A -f -n '__fish_seen_subcommand_from network' -a connect -d 'Connect a container to a network' +complete -c docker -A -f -n '__fish_seen_subcommand_from network' -a create -d 'Create a network' +complete -c docker -A -f -n '__fish_seen_subcommand_from network' -a disconnect -d 'Disconnect a container from a network' +complete -c docker -A -f -n '__fish_seen_subcommand_from network' -a inspect -d 'Display detailed information on one or more networks' +complete -c docker -A -f -n '__fish_seen_subcommand_from network' -a ls -d 'List networks' +complete -c docker -A -f -n '__fish_seen_subcommand_from network' -a prune -d 'Remove all unused networks' +complete -c docker -A -f -n '__fish_seen_subcommand_from network' -a rm -d 'Remove one or more networks' +complete -c docker -A -f -n '__fish_seen_subcommand_from network' -l help -d 'Print usage' +complete -c docker -A -f -n '__fish_seen_subcommand_from network rm' -a '(__fish_print_docker_networks)' -d "Network" +complete -c docker -A -f -n '__fish_seen_subcommand_from network connect' -a '(__fish_print_docker_networks)' -d "Network" +complete -c docker -A -f -n '__fish_seen_subcommand_from network disconnect' -a '(__fish_print_docker_networks)' -d "Network" +complete -c docker -A -f -n '__fish_seen_subcommand_from network inspect' -a '(__fish_print_docker_networks)' -d "Network" + +# port +complete -c docker -f -n '__fish_docker_no_subcommand' -a port -d 'Lookup the public-facing port that is NAT-ed to PRIVATE_PORT' +complete -c docker -A -f -n '__fish_seen_subcommand_from port' -l help -d 'Print usage' +complete -c docker -A -f -n '__fish_seen_subcommand_from port' -a '(__fish_print_docker_containers running)' -d "Container" + +# pause +complete -c docker -f -n '__fish_docker_no_subcommand' -a pause -d 'Pause all processes within a container' +complete -c docker -A -f -n '__fish_seen_subcommand_from pause' -a '(__fish_print_docker_containers running)' -d "Container" + +# ps +complete -c docker -f -n '__fish_docker_no_subcommand' -a ps -d 'List containers' +complete -c docker -A -f -n '__fish_seen_subcommand_from ps' -s a -l all -d 'Show all containers. Only running containers are shown by default.' +complete -c docker -A -f -n '__fish_seen_subcommand_from ps' -l before -d 'Show only container created before Id or Name, include non-running ones.' +complete -c docker -A -f -n '__fish_seen_subcommand_from ps' -s f -l filter -d 'Provide filter values. Valid filters:' +complete -c docker -A -f -n '__fish_seen_subcommand_from ps' -l help -d 'Print usage' +complete -c docker -A -f -n '__fish_seen_subcommand_from ps' -s l -l latest -d 'Show only the latest created container, include non-running ones.' +complete -c docker -A -f -n '__fish_seen_subcommand_from ps' -s n -d 'Show n last created containers, include non-running ones.' +complete -c docker -A -f -n '__fish_seen_subcommand_from ps' -l no-trunc -d "Don't truncate output" +complete -c docker -A -f -n '__fish_seen_subcommand_from ps' -s q -l quiet -d 'Only display container IDs' +complete -c docker -A -f -n '__fish_seen_subcommand_from ps' -s s -l size -d 'Display total file sizes' +complete -c docker -A -f -n '__fish_seen_subcommand_from ps' -l since -d 'Show only containers created since Id or Name, include non-running ones.' + +# pull +complete -c docker -f -n '__fish_docker_no_subcommand' -a pull -d 'Pull an image or a repository from a Docker registry server' +complete -c docker -A -f -n '__fish_seen_subcommand_from pull' -s a -l all-tags -d 'Download all tagged images in the repository' +complete -c docker -A -f -n '__fish_seen_subcommand_from pull' -l help -d 'Print usage' +complete -c docker -A -f -n '__fish_seen_subcommand_from pull' -a '(__fish_print_docker_images)' -d "Image" +complete -c docker -A -f -n '__fish_seen_subcommand_from pull' -a '(__fish_print_docker_repositories)' -d "Repository" + +# push +complete -c docker -f -n '__fish_docker_no_subcommand' -a push -d 'Push an image or a repository to a Docker registry server' +complete -c docker -A -f -n '__fish_seen_subcommand_from push' -l help -d 'Print usage' +complete -c docker -A -f -n '__fish_seen_subcommand_from push' -a '(__fish_print_docker_images)' -d "Image" +complete -c docker -A -f -n '__fish_seen_subcommand_from push' -a '(__fish_print_docker_repositories)' -d "Repository" + +# rename +complete -c docker -f -n '__fish_docker_no_subcommand' -a rename -d 'Rename an existing container' + +# restart +complete -c docker -f -n '__fish_docker_no_subcommand' -a restart -d 'Restart a container' +complete -c docker -A -f -n '__fish_seen_subcommand_from restart' -l help -d 'Print usage' +complete -c docker -A -f -n '__fish_seen_subcommand_from restart' -s t -l time -d 'Number of seconds to try to stop for before killing the container. Once killed it will then be restarted. Default is 10 seconds.' +complete -c docker -A -f -n '__fish_seen_subcommand_from restart' -a '(__fish_print_docker_containers running)' -d "Container" + +# rm +complete -c docker -f -n '__fish_docker_no_subcommand' -a rm -d 'Remove one or more containers' +complete -c docker -A -f -n '__fish_seen_subcommand_from rm' -s f -l force -d 'Force the removal of a running container (uses SIGKILL)' +complete -c docker -A -f -n '__fish_seen_subcommand_from rm' -l help -d 'Print usage' +complete -c docker -A -f -n '__fish_seen_subcommand_from rm' -s l -l link -d 'Remove the specified link and not the underlying container' +complete -c docker -A -f -n '__fish_seen_subcommand_from rm' -s v -l volumes -d 'Remove anonymous volumes associated with the container' +complete -c docker -A -f -n '__fish_seen_subcommand_from rm' -a '(__fish_print_docker_containers stopped)' -d "Container" +complete -c docker -A -f -n '__fish_seen_subcommand_from rm' -s f -l force -a '(__fish_print_docker_containers all)' -d "Container" + +# rmi +complete -c docker -f -n '__fish_docker_no_subcommand' -a rmi -d 'Remove one or more images' +complete -c docker -A -f -n '__fish_seen_subcommand_from rmi' -s f -l force -d 'Force removal of the image' +complete -c docker -A -f -n '__fish_seen_subcommand_from rmi' -l help -d 'Print usage' +complete -c docker -A -f -n '__fish_seen_subcommand_from rmi' -l no-prune -d 'Do not delete untagged parents' +complete -c docker -A -f -n '__fish_seen_subcommand_from rmi' -a '(__fish_print_docker_images)' -d "Image" + +# run +complete -c docker -f -n '__fish_docker_no_subcommand' -a run -d 'Run a command in a new container' +complete -c docker -A -f -n '__fish_seen_subcommand_from run' -s a -l attach -d 'Attach to STDIN, STDOUT or STDERR.' +complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l add-host -d 'Add a custom host-to-IP mapping (host:ip)' +complete -c docker -A -f -n '__fish_seen_subcommand_from run' -s c -l cpu-shares -d 'CPU shares (relative weight)' +complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l cap-add -d 'Add Linux capabilities' +complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l cap-drop -d 'Drop Linux capabilities' +complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l cidfile -d 'Write the container ID to the file' +complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l cgroupns -d 'Cgroup namespace mode to use' +complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l cpuset -d 'CPUs in which to allow execution (0-3, 0,1)' +complete -c docker -A -f -n '__fish_seen_subcommand_from run' -s d -l detach -d 'Detached mode: run the container in the background and print the new container ID' +complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l device -d 'Add a host device to the container (e.g. --device=/dev/sdc:/dev/xvdc:rwm)' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l device-cgroup-rule -d 'Add a rule to the cgroup allowed devices list (e.g. --device-cgroup-rule="c 13:37 rwm")' +complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l dns -d 'Set custom DNS servers' +complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l dns-opt -d "Set custom DNS options (Use --dns-opt='' if you don't wish to set options)" +complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l dns-search -d "Set custom DNS search domains (Use --dns-search=. if you don't wish to set the search domain)" +complete -c docker -A -f -n '__fish_seen_subcommand_from run' -s e -l env -d 'Set environment variables' +complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l entrypoint -d 'Overwrite the default ENTRYPOINT of the image' +complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l env-file -d 'Read in a line delimited file of environment variables' +complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l expose -d 'Expose a port or a range of ports (e.g. --expose=3300-3310) from the container without publishing it to your host' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l group-add -d 'Add additional groups to run as' +complete -c docker -A -f -n '__fish_seen_subcommand_from run' -s h -l hostname -d 'Container host name' +complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l help -d 'Print usage' +complete -c docker -A -f -n '__fish_seen_subcommand_from run' -s i -l interactive -d 'Keep STDIN open even if not attached' +complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l ipc -d 'Default is to create a private IPC namespace (POSIX SysV IPC) for the container' +complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l link -d 'Add link to another container in the form of :alias' +complete -c docker -A -f -n '__fish_seen_subcommand_from run' -s m -l memory -d 'Memory limit (format: [], where unit = b, k, m or g)' +complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l mac-address -d 'Container MAC address (e.g., 92:d0:c6:0a:29:33)' +complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l memory-swap -d "Total memory usage (memory + swap), set '-1' to disable swap (format: [], where unit = b, k, m or g)" +complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l mount -d 'Attach a filesystem mount to the container' +complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l name -d 'Assign a name to the container' +complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l net -d 'Set the Network mode for the container' +complete -c docker -A -f -n '__fish_seen_subcommand_from run' -s P -l publish-all -d 'Publish all exposed ports to random ports on the host interfaces' +complete -c docker -A -f -n '__fish_seen_subcommand_from run' -s p -l publish -d "Publish a container's port to the host" +complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l pid -d 'Default is to create a private PID namespace for the container' +complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l privileged -d 'Give extended privileges to this container' +complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l read-only -d "Mount the container's root filesystem as read only" +complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l restart -d 'Restart policy to apply when a container exits (no, on-failure[:max-retry], always)' +complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l rm -d 'Automatically remove the container when it exits (incompatible with -d)' +complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l security-opt -d 'Security Options' +complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l sig-proxy -d 'Proxy received signals to the process (non-TTY mode only). SIGCHLD, SIGSTOP, and SIGKILL are not proxied.' +complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l stop-signal -d 'Signal to kill a container' +complete -c docker -A -f -n '__fish_seen_subcommand_from run' -s t -l tty -d 'Allocate a pseudo-TTY' +complete -c docker -A -f -n '__fish_seen_subcommand_from run' -s u -l user -d 'Username or UID' +complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l tmpfs -d 'Mount tmpfs on a directory' +complete -c docker -A -f -n '__fish_seen_subcommand_from run' -s v -l volume -d 'Bind mount a volume (e.g., from the host: -v /host:/container, from Docker: -v /container)' +complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l volumes-from -d 'Mount volumes from the specified container(s)' +complete -c docker -A -f -n '__fish_seen_subcommand_from run' -s w -l workdir -d 'Working directory inside the container' +complete -c docker -A -f -n '__fish_seen_subcommand_from run' -a '(__fish_print_docker_images)' -d "Image" + +# save +complete -c docker -f -n '__fish_docker_no_subcommand' -a save -d 'Save an image to a tar archive' +complete -c docker -A -f -n '__fish_seen_subcommand_from save' -l help -d 'Print usage' +complete -c docker -A -f -n '__fish_seen_subcommand_from save' -s o -l output -d 'Write to an file, instead of STDOUT' +complete -c docker -A -f -n '__fish_seen_subcommand_from save' -a '(__fish_print_docker_images)' -d "Image" + +# search +complete -c docker -f -n '__fish_docker_no_subcommand' -a search -d 'Search for an image on the registry (defaults to the Docker Hub)' +complete -c docker -A -f -n '__fish_seen_subcommand_from search' -l automated -d 'Only show automated builds' +complete -c docker -A -f -n '__fish_seen_subcommand_from search' -l help -d 'Print usage' +complete -c docker -A -f -n '__fish_seen_subcommand_from search' -l no-trunc -d "Don't truncate output" +complete -c docker -A -f -n '__fish_seen_subcommand_from search' -s s -l stars -d 'Only displays with at least x stars' + +# start +complete -c docker -f -n '__fish_docker_no_subcommand' -a start -d 'Start a container' +complete -c docker -A -f -n '__fish_seen_subcommand_from start' -s a -l attach -d "Attach container's STDOUT and STDERR and forward all signals to the process" +complete -c docker -A -f -n '__fish_seen_subcommand_from start' -l help -d 'Print usage' +complete -c docker -A -f -n '__fish_seen_subcommand_from start' -s i -l interactive -d "Attach container's STDIN" +complete -c docker -A -f -n '__fish_seen_subcommand_from start' -a '(__fish_print_docker_containers stopped)' -d "Container" + +# stats +complete -c docker -f -n '__fish_docker_no_subcommand' -a stats -d "Display a live stream of one or more containers' resource usage statistics" +complete -c docker -A -f -n '__fish_seen_subcommand_from stats' -l help -d 'Print usage' +complete -c docker -A -f -n '__fish_seen_subcommand_from stats' -l no-stream -d 'Disable streaming stats and only pull the first result' +complete -c docker -A -f -n '__fish_seen_subcommand_from stats' -a '(__fish_print_docker_containers running)' -d "Container" + +# stop +complete -c docker -f -n '__fish_docker_no_subcommand' -a stop -d 'Stop a container' +complete -c docker -A -f -n '__fish_seen_subcommand_from stop' -l help -d 'Print usage' +complete -c docker -A -f -n '__fish_seen_subcommand_from stop' -s t -l time -d 'Number of seconds to wait for the container to stop before killing it. Default is 10 seconds.' +complete -c docker -A -f -n '__fish_seen_subcommand_from stop' -a '(__fish_print_docker_containers running)' -d "Container" + +# tag +complete -c docker -f -n '__fish_docker_no_subcommand' -a tag -d 'Tag an image into a repository' +complete -c docker -A -f -n '__fish_seen_subcommand_from tag' -s f -l force -d 'Force' +complete -c docker -A -f -n '__fish_seen_subcommand_from tag' -l help -d 'Print usage' + +# top +complete -c docker -f -n '__fish_docker_no_subcommand' -a top -d 'Lookup the running processes of a container' +complete -c docker -A -f -n '__fish_seen_subcommand_from top' -l help -d 'Print usage' +complete -c docker -A -f -n '__fish_seen_subcommand_from top' -a '(__fish_print_docker_containers running)' -d "Container" + +#trust +complete -c docker -f -n '__fish_docker_no_subcommand' -a trust -d 'Manage trust on Docker images' +complete -c docker -A -f -n '__fish_seen_subcommand_from trust' -l help -d 'Print usage' + +#trust inspect +complete -c docker -A -f -n '__fish_docker_no_subcommand_trust' -a inspect -d 'Return low-level information about keys and signatures' +complete -c docker -A -f -n '__fish_docker_subcommand_path trust inspect' -l pretty -d 'Print the information in a human friendly format' + +#trust key +complete -c docker -A -f -n '__fish_docker_no_subcommand_trust' -a key -d 'Manage keys for signing Docker images' +complete -c docker -A -f -n '__fish_docker_subcommand_path trust key; and __fish_docker_subcommand_path_without generate load' -a generate -d 'Generate and load a signing key-pair' +complete -c docker -A -f -n '__fish_docker_subcommand_path trust key load' -l dir -d 'Directory to generate key in, defaults to current directory' +complete -c docker -A -f -n '__fish_docker_subcommand_path trust key; and __fish_docker_subcommand_path_without generate load' -a load -d 'Load a private key file for signing' +complete -c docker -A -f -n '__fish_docker_subcommand_path trust key load' -l name -d 'Name for the loaded key (default "signer")' + +#trust revoke +complete -c docker -A -f -n '__fish_docker_no_subcommand_trust' -a revoke -d 'Remove trust for an image' +complete -c docker -A -f -n '__fish_docker_subcommand_path trust revoke' -s y -l yes -d 'Do not prompt for confirmation' + +#trust sign +complete -c docker -A -f -n '__fish_docker_no_subcommand_trust' -a sign -d 'Sign an image' +complete -c docker -A -f -n '__fish_docker_subcommand_path trust sign' -l local -d 'Sign a locally tagged image' + +#trust signer +complete -c docker -A -f -n '__fish_docker_no_subcommand_trust' -a signer -d 'Manage entities who can sign Docker images' +complete -c docker -A -f -n '__fish_docker_subcommand_path trust signer; and __fish_docker_subcommand_path_without add remove' -a add -d 'Add a signer' +complete -c docker -A -f -n '__fish_docker_subcommand_path trust signer; and __fish_docker_subcommand_path_without add remove' -a remove -d 'remove a signer' + +# unpause +complete -c docker -f -n '__fish_docker_no_subcommand' -a unpause -d 'Unpause a paused container' +complete -c docker -A -f -n '__fish_seen_subcommand_from unpause' -a '(__fish_print_docker_containers running)' -d "Container" + +# version +complete -c docker -f -n '__fish_docker_no_subcommand' -a version -d 'Show the Docker version information' +complete -c docker -A -f -n '__fish_seen_subcommand_from version' -s f -l format -d 'Format the output using the given go template' +complete -c docker -A -f -n '__fish_seen_subcommand_from version' -l help -d 'Print usage' + +# wait +complete -c docker -f -n '__fish_docker_no_subcommand' -a wait -d 'Block until a container stops, then print its exit code' +complete -c docker -A -f -n '__fish_seen_subcommand_from wait' -l help -d 'Print usage' +complete -c docker -A -f -n '__fish_seen_subcommand_from wait' -a '(__fish_print_docker_containers running)' -d "Container" diff --git a/fish/completions/doctl.fish b/fish/completions/doctl.fish new file mode 100644 index 0000000..5b16b84 --- /dev/null +++ b/fish/completions/doctl.fish @@ -0,0 +1,318 @@ + +# Completions for the global flags +complete -c doctl -s h -l help -d 'Show help' +complete -c doctl -s t -l access-token -d "API V2 access token" +complete -c doctl -s u -l api-url -d "Overide default API endpoint" +complete -c doctl -s c -l config -d "Specify a custom config file" +complete -c doctl -l context -d "Specify a custom authentication context name" +complete -c doctl -s o -l output -d "Desired output format [text|json] (default \"text\")" +complete -c doctl -l trace -d "Show a log of network activity" +complete -c doctl -s v -l verbose -d "Enable verbose output" + +# Completions for the 'doctl' root command +complete -c doctl -n '__fish_use_subcommand' -a account -d "Retrieve account details" +complete -c doctl -n '__fish_use_subcommand' -a auth -d "Authenticating doctl with an account" +complete -c doctl -n '__fish_use_subcommand' -a balance -d "Retrieving your account balance" +complete -c doctl -n '__fish_use_subcommand' -a completion -d "Autocomplete doctl commands" +complete -c doctl -n '__fish_use_subcommand' -a compute -d "Manage infrastructure" +complete -c doctl -n '__fish_use_subcommand' -a databases -d "Manage databases" +complete -c doctl -n '__fish_use_subcommand' -a help -d "Show helps" +complete -c doctl -n '__fish_use_subcommand' -a invoice -d "Retrieving invoices for your account" +complete -c doctl -n '__fish_use_subcommand' -a kubernetes -d "Manage Kubernetes clusters and configurations" +complete -c doctl -n '__fish_use_subcommand' -a projects -d "Manage projects and assign resources to them" +complete -c doctl -n '__fish_use_subcommand' -a version -d "Show the current version" + +# Completions for the 'doctl account' command +complete -c doctl -n '__fish_seen_subcommand_from account' -a get -d "Account profile details" +complete -c doctl -n '__fish_seen_subcommand_from account' -a ratelimit -d "API usage and the remaining quota" + +# Completions for the 'doctl account get' command +complete -c doctl -n '__fish_seen_subcommand_from account get' -l format -d "Columns for output" +complete -c doctl -n '__fish_seen_subcommand_from account get' -l no-header -d "Return raw data with no headers" + +# COmpletions for the 'doctl account ratelimit' command +complete -c doctl -n '__fish_seen_subcommand_from account ratelimit' -l format -d "Columns for output" +complete -c doctl -n '__fish_seen_subcommand_from account ratelimit' -l no-header -d "Return raw data with no headers" + +# Completions for the 'doctl auth' command +complete -c doctl -n '__fish_seen_subcommand_from auth' -a init -d "Initialize doctl" +complete -c doctl -n '__fish_seen_subcommand_from auth' -a list -d "List available authentication context" +complete -c doctl -n '__fish_seen_subcommand_from auth' -a switch -d "Switches between authentication contexts" + +# COmpletions for the 'doctl auth list' command +complete -c doctl -n '__fish_seen_subcommand_from auth list' -l format -d "Columns for output" + +# Completions for the 'doctl balance' command +complete -c doctl -n '__fish_seen_subcommand_from balance' -a get -d "Account balance" + +# COmpletions for the 'doctl balance get' command +complete -c doctl -n '__fish_seen_subcommand_from balance get' -l format -d "Columns for output" +complete -c doctl -n '__fish_seen_subcommand_from balance get' -l no-header -d "Return raw data with no headers" + +# Completions for the 'doctl completion' command +complete -c doctl -n '__fish_seen_subcommand_from completion' -a bash -d "Generate completion code for bash" +complete -c doctl -n '__fish_seen_subcommand_from completion' -a fish -d "Generate completion code for fish" +complete -c doctl -n '__fish_seen_subcommand_from completion' -a zsh -d "Generate completion code for zsh" + +# Completions for the 'doctl compute' command +complete -c doctl -n '__fish_seen_subcommand_from compute' -a action -d "Display commands for retrieving resource action history" +complete -c doctl -n '__fish_seen_subcommand_from compute' -a cdn -d "Display commands that manage CDNs" +complete -c doctl -n '__fish_seen_subcommand_from compute' -a certificate -d "Display commands that manage SSL certificates and private keys" +complete -c doctl -n '__fish_seen_subcommand_from compute' -a domain -d "Display commands that manage domains" +complete -c doctl -n '__fish_seen_subcommand_from compute' -a droplet -d "Manage virtual machines (Droplets)" +complete -c doctl -n '__fish_seen_subcommand_from compute' -a droplet-action -d "Display Droplet action commands" +complete -c doctl -n '__fish_seen_subcommand_from compute' -a firewall -d "Display commands to manage cloud firewalls" +complete -c doctl -n '__fish_seen_subcommand_from compute' -a floating-ip -d "Display commands to manage floating IP addresses" +complete -c doctl -n '__fish_seen_subcommand_from compute' -a floating-ip-action -d "Display commands to associate floating IP addresses with Droplets" +complete -c doctl -n '__fish_seen_subcommand_from compute' -a image -d "Display commands to manage images" +complete -c doctl -n '__fish_seen_subcommand_from compute' -a image-action -d "Display commands to perform actions on images" +complete -c doctl -n '__fish_seen_subcommand_from compute' -a load-balancer -d "Display commands to manage load balancers" +complete -c doctl -n '__fish_seen_subcommand_from compute' -a region -d "Display commands to list datacenter regions" +complete -c doctl -n '__fish_seen_subcommand_from compute' -a size -d "List available Droplet sizes" +complete -c doctl -n '__fish_seen_subcommand_from compute' -a snapshot -d "Access and manage snapshots" +complete -c doctl -n '__fish_seen_subcommand_from compute' -a ssh -d "Access a Droplet using SSH" +complete -c doctl -n '__fish_seen_subcommand_from compute' -a ssh-key -d "Display commands to manage SSH keys on your account" +complete -c doctl -n '__fish_seen_subcommand_from compute' -a tag -d "Display commands to manage tags" +complete -c doctl -n '__fish_seen_subcommand_from compute' -a volume -d "Display commands to manage block storage volumes" +complete -c doctl -n '__fish_seen_subcommand_from compute' -a volume-action -d "Display commands to perform actions on a volume" + +# Completions for the 'doctl compute action' command +complete -c doctl -n '__fish_seen_subcommand_from compute action' -a get -d "Retrieve details about a specific action" +complete -c doctl -n '__fish_seen_subcommand_from compute action' -a list -d "Retrieve a list of all recent actions taken on your resources" +complete -c doctl -n '__fish_seen_subcommand_from compute action' -a wait -d "Block thread until an action completes" + +# Completions for the 'doctl compute action get' command +complete -c doctl -n '__fish_seen_subcommand_from compute action get' -l format -d "Columns for output" +complete -c doctl -n '__fish_seen_subcommand_from compute action get' -l no-header -d "Return raw data with no headers" + +# Completions for the 'doctl compute action list' command +complete -c doctl -n '__fish_seen_subcommand_from compute action list' -l action-type -d "Action type" +complete -c doctl -n '__fish_seen_subcommand_from compute action list' -l after -d "Action completed after in RFC3339 format" +complete -c doctl -n '__fish_seen_subcommand_from compute action list' -l before -d "Action completed before in RFC3339 format" +complete -c doctl -n '__fish_seen_subcommand_from compute action list' -l format -d "Columns for output" +complete -c doctl -n '__fish_seen_subcommand_from compute action list' -l no-header -d "Return raw data with no headers" +complete -c doctl -n '__fish_seen_subcommand_from compute action list' -l region -d "Action region" +complete -c doctl -n '__fish_seen_subcommand_from compute action list' -l resource-type -d "Action resource type" +complete -c doctl -n '__fish_seen_subcommand_from compute action list' -l status -d "Action status" + +# Completions for the 'doctl compute action wait' command +complete -c doctl -n '__fish_seen_subcommand_from compute action wait' -l no-header -d "Return raw data with no headers" +complete -c doctl -n '__fish_seen_subcommand_from compute action wait' -l poll-timeout -d "Re-poll time in seconds" + +# Completions for the 'doctl databases' command +complete -c doctl -n '__fish_seen_subcommand_from databases' -a backups -d "List database cluster backups" +complete -c doctl -n '__fish_seen_subcommand_from databases' -a connection -d "Retrieve connection details for a database cluster" +complete -c doctl -n '__fish_seen_subcommand_from databases' -a create -d "Create a database cluster" +complete -c doctl -n '__fish_seen_subcommand_from databases' -a db -d "Display commands for managing individual databases within a cluster" +complete -c doctl -n '__fish_seen_subcommand_from databases' -a delete -d "Delete a database cluster" +complete -c doctl -n '__fish_seen_subcommand_from databases' -a get -d "Get details for a database cluster" +complete -c doctl -n '__fish_seen_subcommand_from databases' -a list -d "List your database clusters" +complete -c doctl -n '__fish_seen_subcommand_from databases' -a maintenance-window -d "Display commands for scheduling automatic maintenance on your database cluster" +complete -c doctl -n '__fish_seen_subcommand_from databases' -a migrate -d "Migrate a database cluster to a new region" +complete -c doctl -n '__fish_seen_subcommand_from databases' -a pool -d "Display commands for managing connection pools" +complete -c doctl -n '__fish_seen_subcommand_from databases' -a replica -d "Display commands to manage read-only database replicas" +complete -c doctl -n '__fish_seen_subcommand_from databases' -a resize -d "Resize a database cluster" +complete -c doctl -n '__fish_seen_subcommand_from databases' -a sql-mode -d "Display commands to configure a MySQL database cluster's SQL modes" +complete -c doctl -n '__fish_seen_subcommand_from databases' -a user -d "Display commands for managing database users" + +# Completions for the 'doctl databases backups' command +complete -c doctl -n '__fish_seen_subcommand_from databases backups' -l format -d "Columns for output" +complete -c doctl -n '__fish_seen_subcommand_from databases backups' -l no-header -d "Return raw data with no headers" + +# Completions for the 'doctl databases connection' command +complete -c doctl -n '__fish_seen_subcommand_from databases connection' -l format -d "Columns for output" +complete -c doctl -n '__fish_seen_subcommand_from databases connection' -l no-header -d "Return raw data with no headers" + +# Completions for the 'doctl databases create' command +complete -c doctl -n '__fish_seen_subcommand_from databases create' -l engine -d "Database engine to be used for the cluster" +complete -c doctl -n '__fish_seen_subcommand_from databases create' -l num-nodes -d "Number of nodes in the database cluster" +complete -c doctl -n '__fish_seen_subcommand_from databases create' -l private-network-uuid -d "UUID to use for private network connection" +complete -c doctl -n '__fish_seen_subcommand_from databases create' -l region -d "Region where the database cluster will be created" +complete -c doctl -n '__fish_seen_subcommand_from databases create' -l size -d "Size of the nodes in the database cluster" +complete -c doctl -n '__fish_seen_subcommand_from databases create' -l version -d "Database engine version" + +# Completions for the 'doctl databases db' command +complete -c doctl -n '__fish_seen_subcommand_from databases db' -a create -d "Create a database within a cluster" +complete -c doctl -n '__fish_seen_subcommand_from databases db' -a delete -d "Delete the specified database from the cluster" +complete -c doctl -n '__fish_seen_subcommand_from databases db' -a get -d "Retrieve the name of a database within a cluster" +complete -c doctl -n '__fish_seen_subcommand_from databases db' -a list -d "Retrieve a list of databases within a cluster" + +# Completions for the 'doctl invoice' command +complete -c doctl -n '__fish_seen_subcommand_from invoice' -a csv -d "Download a CSV file of an invoice" +complete -c doctl -n '__fish_seen_subcommand_from invoice' -a get -d "Retrieve a list of all the items on an invoice" +complete -c doctl -n '__fish_seen_subcommand_from invoice' -a list -d "List all of the invoices for your account" +complete -c doctl -n '__fish_seen_subcommand_from invoice' -a pdf -d "Download a PDF file of an invoice" +complete -c doctl -n '__fish_seen_subcommand_from invoice' -a summary -d "Get a summary of an invoice" + +# Completions for the 'doctl invoice get' command +complete -c doctl -n '__fish_seen_subcommand_from invoice get' -l format -d "Columns for output" +complete -c doctl -n '__fish_seen_subcommand_from invoice get' -l no-header -d "Return raw data with no headers" + +# Completions for the 'doctl invoice list' command +complete -c doctl -n '__fish_seen_subcommand_from invoice list' -l format -d "Columns for output" +complete -c doctl -n '__fish_seen_subcommand_from invoice list' -l no-header -d "Return raw data with no headers" + +# Completions for the 'doctl invoice summary' command +complete -c doctl -n '__fish_seen_subcommand_from invoice summary' -l format -d "Columns for output" +complete -c doctl -n '__fish_seen_subcommand_from invoice summary' -l no-header -d "Return raw data with no headers" + +# Completions for the 'doctl kubernetes' command +complete -c doctl -n '__fish_seen_subcommand_from kubernetes' -a cluster -d "Display commands for managing Kubernetes clusters" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes' -a options -d "List possible option values for use inside Kubernetes commands" + +# Completions for the 'doctl kubernetes cluster' command +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster' -a create -d "Create a Kubernetes cluster" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster' -a delete -d "Delete Kubernetes clusters" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster' -a get -d "Retrieve details about a Kubernetes cluster" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster' -a get-upgrades -d "Retrieve a list of available Kubernetes version upgrades" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster' -a kubeconfig -d "Display commands for managing your local kubeconfig" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster' -a list -d "Retrieve the list of Kubernetes clusters for your account" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster' -a node-pool -d "Display commands for managing node pools" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster' -a update -d "Update a Kubernetes cluster's configuration" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster' -a upgrade -d "Upgrades a cluster to a new Kubernetes version" + +# Completions for the 'doctl kubernetes cluster create' command +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster create' -l auto-upgrade -d "Boolean specifying whether to enable auto-upgrade for the cluster" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster create' -l count -d "Number of nodes in the default node pool" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster create' -l maintenance-window -d "Sets the beginning of the four hour maintenance window" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster create' -l node-pool -d "Comma-separated list of node pools" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster create' -l size -d "Machine size to use when creating nodes in the default node pool" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster create' -l tag -d "Comma-separated list of tags to apply to the cluster" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster create' -l update-kubeconfig -d "Boolean that specifies whether to add a configuration context" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster create' -l version -d "Kubernetes version" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster create' -l wait -d "Boolean that specifies whether to wait for cluster creation" + +# Completions for the 'doctl kubernetes cluster delete' command +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster delete' -l force -d "Boolean indicating whether to delete the cluster without a confirmation prompt" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster delete' -l update-kuberconfig -d "Boolean indicating whether to remove the deleted cluster from your kubeconfig" + +# Completions for the 'doctl kubernetes cluster get' command +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster get' -l format -d "Columns for output" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster get' -l no-header -d "Return raw data with no headers" + +# Completions for the 'doctl kubernetes cluster kubeconfig' command +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster kubeconfig' -a remove -d "Remove a cluster's credentials from your local kubeconfig" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster kubeconfig' -a save -d "Save a cluster's credentials to your local kubeconfig" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster kubeconfig' -a show -d "Show a Kubernetes cluster's kubeconfig YAML" + +# Completions for the 'doctl kubernetes cluster kubeconfig save' command +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster kubeconfig save' -a set-current-context -d "Boolean indicating whether to set the current kubectl context" + +# Completions for the 'doctl kubernetes cluster list' command +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster list' -l format -d "Columns for output" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster list' -l no-header -d "Return raw data with no headers" + +# Completions for the 'doctl kubernetes cluster node-pool' command +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster node-pool' -a create -d "Create a new node pool for a cluster" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster node-pool' -a delete -d "Delete a node pool" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster node-pool' -a delete-node -d "Delete a node" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster node-pool' -a get -d "Retrieve information about a cluster's node pool" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster node-pool' -a list -d "List a cluster's node pools" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster node-pool' -a replace-node -d "Replace node with a new one" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster node-pool' -a update -d "Update an existing node pool in a cluster" + +# Completions for the 'doctl kubernetes cluster node-pool create' command +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster node-pool create' -l auto-scale -d "Boolean indicating whether to enable auto-scaling on the node pool" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster node-pool create' -rl count -d "Size of (number of nodes in) the node pool" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster node-pool create' -l label -d "Label in key=value notation to apply to the node pool" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster node-pool create' -l max-nodes -d "Maximum number of nodes in the node pool when autoscaling is enabled" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster node-pool create' -l min-nodes -d "Minimum number of nodes in the node pool when autoscaling is enabled" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster node-pool create' -l name -d "Name of the node pool" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster node-pool create' -rl size -d "Size of the nodes in the node pool" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster node-pool create' -l tag -d "Tag to apply to the node pool" + +# Completions for the 'doctl kubernetes cluster node-pool delete' command +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster node-pool delete' -l force -d "Delete node pool without confirmation prompt" + +# Completions for the 'doctl kubernetes cluster node-pool delete-node' command +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster node-pool delete-node' -l force -d "Delete the node without a confirmation prompt" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster node-pool delete-node' -l skip-drain -d "Skip draining the node before deletion" + +# Completions for the 'doctl kubernetes cluster node-pool get' command +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster node-pool get' -l format -d "Columns for output" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster node-pool get' -l no-header -d "Return raw data with no headers" + +# Completions for the 'doctl kubernetes cluster node-pool list' command +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster node-pool list' -l format -d "Columns for output" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster node-pool list' -l no-header -d "Return raw data with no headers" + +# Completions for the 'doctl kubernetes cluster node-pool replace-node' command +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster node-pool replace-node' -l force -d "Delete the node without a confirmation prompt" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster node-pool replace-node' -l skip-drain -d "Skip draining the node before deletion" + +# Completions for the 'doctl kubernetes cluster node-pool update' command +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster node-pool update' -l auto-scale -d "Boolean indicating whether to enable auto-scaling on the node pool" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster node-pool update' -l count -d "Size of (number of nodes in) the node pool" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster node-pool update' -l label -d "Label in key=value notation to apply to the node pool" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster node-pool update' -l max-nodes -d "Maximum number of nodes in the node pool when autoscaling is enabled" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster node-pool update' -l min-nodes -d "Minimum number of nodes in the node pool when autoscaling is enabled" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster node-pool update' -l name -d "Name of the node pool" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster node-pool update' -l size -d "Size of the nodes in the node pool" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster node-pool update' -l tag -d "Tag to apply to the node pool" + +# Completions for the 'doctl kubernetes cluster update' command +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster update' -l auto-upgrade -d "Boolean specifying whether to enable auto-upgrade for the cluster" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster update' -l cluster-name -d "Specifies a new cluster name" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster update' -l maintenance-window -d "Sets the beginning of the four hour maintenance window for the cluster" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster update' -l set-current-context -d "Boolean specifying whether to set the current kubectl context" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster update' -l tag -d "A comma-separated list of tags to apply to the cluster" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster update' -l update-kubeconfig -d "Boolean specifying whether to update the cluster" + +# Completions for the 'doctl kubernetes cluster upgrade' command +complete -c doctl -n '__fish_seen_subcommand_from kubernetes cluster upgrade' -l version -d "Desired Kubernetes version" + +# Completions for the 'doctl kubernetes options' command +complete -c doctl -n '__fish_seen_subcommand_from kubernetes options' -a regions -d "List regions that support DigitalOcean Kubernetes clusters" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes options' -a sizes -d "List machine sizes that can be used in a DigitalOcean Kubernetes cluster" +complete -c doctl -n '__fish_seen_subcommand_from kubernetes options' -a versions -d "List Kubernetes versions that can be used with DigitalOcean clusters" + +# Completions for the 'doctl projects' command +complete -c doctl -n '__fish_seen_subcommand_from projects' -a create -d "Create a new project" +complete -c doctl -n '__fish_seen_subcommand_from projects' -a delete -d "Delete the specified project" +complete -c doctl -n '__fish_seen_subcommand_from projects' -a get -d "Retrieve details for a specific project" +complete -c doctl -n '__fish_seen_subcommand_from projects' -a list -d "List existing projects" +complete -c doctl -n '__fish_seen_subcommand_from projects' -a resources -d "Manage resources assigned to a project" +complete -c doctl -n '__fish_seen_subcommand_from projects' -a update -d "Update an existing project" + +# Completions for the 'doctl projects create' command +complete -c doctl -n '__fish_seen_subcommand_from projects create' -l description -d "Dscription of the project" +complete -c doctl -n '__fish_seen_subcommand_from projects create' -l environment -d "Environment in which your project resides." +complete -c doctl -n '__fish_seen_subcommand_from projects create' -l format -d "Columns for output in a comma-separated list." +complete -c doctl -n '__fish_seen_subcommand_from projects create' -rl name -d "Name for the project" +complete -c doctl -n '__fish_seen_subcommand_from projects create' -rl no-header -d "Return raw data with no headers" +complete -c doctl -n '__fish_seen_subcommand_from projects create' -rl purpose -d "Project's purpose" + +# Completions for the 'doctl projects delete' command +complete -c doctl -n '__fish_seen_subcommand_from doctl projects delete' -l force -d "Delete the project without confirmation" + +# Completions for the 'doctl projects get' command +complete -c doctl -n '__fish_seen_subcommand_from projects get' -l format -d "Columns for output" +complete -c doctl -n '__fish_seen_subcommand_from projects get' -l no-header -d "Return raw data with no headers" + +# Completions for the 'doctl projects list' command +complete -c doctl -n '__fish_seen_subcommand_from projects list' -l format -d "Columns for output" +complete -c doctl -n '__fish_seen_subcommand_from projects list' -l no-header -d "Return raw data with no headers" + +# Completions for the 'doctl projects resources' command +complete -c doctl -n '__fish_seen_subcommand_from projects resources' -a assign -d "Assign one or more resources to a project" +complete -c doctl -n '__fish_seen_subcommand_from projects resources' -a get -d "Retrieve a resource by its URN" +complete -c doctl -n '__fish_seen_subcommand_from projects resources' -a list -d "List resources assigned to a project" + +# Completions for the 'doctl projects resources assign' command +complete -c doctl -n '__fish_seen_subcommand_from projects resources assign' -l resource -d "URNs specifying resources to assign to the project" + +# Completions for the 'doctl projects resources get' command +complete -c doctl -n '__fish_seen_subcommand_from projects resources get' -l format -d "Columns for output" +complete -c doctl -n '__fish_seen_subcommand_from projects resources get' -l no-header -d "Return raw data with no headers" + +# Completions for the 'doctl projects resources list' command +complete -c doctl -n '__fish_seen_subcommand_from projects resources list' -l format -d "Columns for output" +complete -c doctl -n '__fish_seen_subcommand_from projects resources list' -l no-header -d "Return raw data with no headers" + +# Completions for the 'doctl projects update' command +complete -c doctl -n '__fish_seen_subcommand_from projects update' -l description -d "Description of the project" +complete -c doctl -n '__fish_seen_subcommand_from projects update' -l environment -d "Environment in which your project resides." +complete -c doctl -n '__fish_seen_subcommand_from projects update' -l format -d "Columns for output in a comma-separated list." +complete -c doctl -n '__fish_seen_subcommand_from projects update' -rl name -d "Name for the project" +complete -c doctl -n '__fish_seen_subcommand_from projects update' -l no-header -d "Return raw data with no headers" +complete -c doctl -n '__fish_seen_subcommand_from projects update' -rl purpose -d "Project's purpose" diff --git a/fish/completions/fisher.fish b/fish/completions/fisher.fish new file mode 100644 index 0000000..6d23ce4 --- /dev/null +++ b/fish/completions/fisher.fish @@ -0,0 +1,7 @@ +complete --command fisher --exclusive --long help --description "Print help" +complete --command fisher --exclusive --long version --description "Print version" +complete --command fisher --exclusive --condition __fish_use_subcommand --arguments install --description "Install plugins" +complete --command fisher --exclusive --condition __fish_use_subcommand --arguments update --description "Update installed plugins" +complete --command fisher --exclusive --condition __fish_use_subcommand --arguments remove --description "Remove installed plugins" +complete --command fisher --exclusive --condition __fish_use_subcommand --arguments list --description "List installed plugins matching regex" +complete --command fisher --exclusive --condition "__fish_seen_subcommand_from update remove" --arguments "(fisher list)" diff --git a/fish/completions/fzf_configure_bindings.fish b/fish/completions/fzf_configure_bindings.fish new file mode 100644 index 0000000..a78fd54 --- /dev/null +++ b/fish/completions/fzf_configure_bindings.fish @@ -0,0 +1,7 @@ +complete fzf_configure_bindings --no-files +complete fzf_configure_bindings --long help --short h --description "Print help" +complete fzf_configure_bindings --long directory --description "Change the key binding for searching directory" +complete fzf_configure_bindings --long git_log --description "Change the key binding for searching git log" +complete fzf_configure_bindings --long git_status --description "Change the key binding for searching git status" +complete fzf_configure_bindings --long history --description "Change the key binding for searching history" +complete fzf_configure_bindings --long variables --description "Change the key binding for searching variables" diff --git a/fish/completions/gcloud.fish b/fish/completions/gcloud.fish new file mode 100644 index 0000000..035a1f8 --- /dev/null +++ b/fish/completions/gcloud.fish @@ -0,0 +1,2 @@ + +complete -f -c gcloud -a '(gcloud_sdk_argcomplete)' diff --git a/fish/completions/gsutil.fish b/fish/completions/gsutil.fish new file mode 100644 index 0000000..9717b65 --- /dev/null +++ b/fish/completions/gsutil.fish @@ -0,0 +1,2 @@ + +complete -x -c gsutil -a '(gcloud_sdk_argcomplete)' diff --git a/fish/completions/kubectl.fish b/fish/completions/kubectl.fish new file mode 100644 index 0000000..6b719d5 --- /dev/null +++ b/fish/completions/kubectl.fish @@ -0,0 +1,1762 @@ +# +set -q FISH_KUBECTL_COMPLETION_TIMEOUT; or set FISH_KUBECTL_COMPLETION_TIMEOUT 5s +set -q FISH_KUBECTL_COMPLETION_COMPLETE_CRDS; or set FISH_KUBECTL_COMPLETION_COMPLETE_CRDS 1 +set __fish_kubectl_timeout "--request-timeout=$FISH_KUBECTL_COMPLETION_TIMEOUT" +set __fish_kubectl_all_namespaces_flags "--all-namespaces" "--all-namespaces=true" +set __fish_kubectl_subresource_commands get describe delete edit label explain +set __fish_kubectl_commands alpha \ + annotate \ + api-resources \ + api-versions \ + apply \ + attach \ + auth \ + autoscale \ + certificate \ + cluster-info \ + completion \ + config \ + cordon \ + cp \ + create \ + debug \ + delete \ + describe \ + diff \ + drain \ + edit \ + exec \ + explain \ + expose \ + get \ + kustomize \ + label \ + logs \ + options \ + patch \ + plugin \ + port-forward \ + proxy \ + replace \ + rollout \ + run \ + scale \ + set \ + taint \ + top \ + uncordon \ + version \ + wait + +function __fish_kubectl + set -l context_args + + if set -l context_flags (__fish_kubectl_get_context_flags | string split " ") + for c in $context_flags + set context_args $context_args $c + end + end + + set -l kubeconfig_args + + if set -l kubeconfig_args (__fish_kubectl_get_kubeconfig_flags | string split " ") + for c in $kubeconfig_args + set kubeconfig_args $kubeconfig_args $c + end + end + + command kubectl $__fish_kubectl_timeout $context_args $kubeconfig_args $argv +end + +function __fish_kubectl_get_commands + echo alpha\t'Commands for features in alpha' + echo annotate\t'Update the annotations on a resource' + echo api-resources\t'Print the supported API resources on the server' + echo api-versions\t'Print the supported API versions on the server, in the form of "group/version"' + echo apply\t'Apply a configuration to a resource by filename or stdin' + echo attach\t'Attach to a running container' + echo auth\t'Inspect authorization' + echo autoscale\t'Auto-scale a Deployment, ReplicaSet, or ReplicationController' + echo certificate\t'Modify certificate resources.' + echo cluster-info\t'Display cluster info' + echo completion\t'Output shell completion code for the specified shell (bash or zsh)' + echo config\t'Modify kubeconfig files' + echo cordon\t'Mark node as unschedulable' + echo cp\t'Copy files and directories to and from containers.' + echo create\t'Create a resource from a file or from stdin.' + echo debug\t'Create debugging sessions for troubleshooting workloads and nodes' + echo delete\t'Delete resources by filenames, stdin, resources and names, or by resources and label selector' + echo describe\t'Show details of a specific resource or group of resources' + echo diff\t'Diff live version against would-be applied version' + echo drain\t'Drain node in preparation for maintenance' + echo edit\t'Edit a resource on the server' + echo exec\t'Execute a command in a container' + echo explain\t'Documentation of resources' + echo expose\t'Take a replication controller, service, deployment or pod and expose it as a new Kubernetes Service' + echo get\t'Display one or many resources' + echo kustomize\t'Build a kustomization target from a directory or a remote url.' + echo label\t'Update the labels on a resource' + echo logs\t'Print the logs for a container in a pod' + echo options\t'Print the list of flags inherited by all commands' + echo patch\t'Update field(s) of a resource' + echo plugin\t'Provides utilities for interacting with plugins.' + echo port-forward\t'Forward one or more local ports to a pod' + echo proxy\t'Run a proxy to the Kubernetes API server' + echo replace\t'Replace a resource by filename or stdin' + echo rollout\t'Manage the rollout of a resource' + echo run\t'Run a particular image on the cluster' + echo scale\t'Set a new size for a Deployment, ReplicaSet or Replication Controller' + echo set\t'Set specific features on objects' + echo taint\t'Update the taints on one or more nodes' + echo top\t'Display Resource (CPU/Memory/Storage) usage.' + echo uncordon\t'Mark node as schedulable' + echo version\t'Print the client and server version information' + echo wait\t'Experimental: Wait for a specific condition on one or many resources.' +end + +set __fish_kubectl_resources \ + all \ + certificatesigningrequests csr \ + clusterrolebindings \ + clusterroles \ + clusters \ + componentstatuses cs \ + configmaps configmap cm \ + controllerrevisions \ + cronjobs cj \ + customresourcedefinition crd crds \ + daemonsets ds \ + deployments deployment deploy \ + endpoints ep \ + events ev \ + horizontalpodautoscalers hpa \ + ingresses ingress ing \ + jobs job \ + limitranges limits \ + namespaces namespace ns \ + networkpolicies netpol \ + nodes node no \ + persistentvolumeclaims pvc \ + persistentvolumes pv \ + poddisruptionbudgets pdb \ + podpreset \ + pods pod po \ + podsecuritypolicies psp \ + podtemplates \ + replicasets rs \ + replicationcontrollers rc \ + resourcequotas quota \ + rolebindings \ + roles \ + secrets secret \ + serviceaccounts sa \ + services service svc \ + statefulsets sts \ + storageclass storageclasses sc + +set __fish_kubectl_cached_crds "" +set __fish_kubectl_last_crd_fetch "" + +function __fish_kubectl_actually_get_crds + set __fish_kubectl_cached_crds (__fish_kubectl get crd -o jsonpath='{range .items[*]}{.spec.names.plural}{"\n"}{.spec.names.singular}{"\n"}{range .spec.names.shortNames[]}{@}{"\n"}{end}{end}' 2>/dev/null) + set __fish_kubectl_last_crd_fetch (__fish_kubectl_get_current_time) + for i in $__fish_kubectl_cached_crds + echo $i + end +end + +function __fish_kubectl_get_current_time + date +'%s' +end + +function __fish_kubectl_get_crds + if test -z "$__fish_kubectl_last_crd_fetch"; or test -z "$__fish_kubectl_cached_crds" + __fish_kubectl_actually_get_crds + return 0 + end + + set -l ct (__fish_kubectl_get_current_time) + set -l duration (math $ct-$__fish_kubectl_last_crd_fetch) + # Only fetch crds if we have not fetched them within the past 30 seconds. + if test "$duration" -gt 30 + __fish_kubectl_actually_get_crds + return 0 + end + + for i in $__fish_kubectl_cached_crds + echo $i + end +end + +function __fish_kubectl_seen_subcommand_from_regex + set -l cmd (commandline -poc) + set -e cmd[1] + for i in $cmd + for r in $argv + if string match -r -- $r $i + return 0 + end + end + end + return 1 +end + +function __fish_kubectl_needs_command -d 'Test if kubectl has yet to be given the subcommand' + for i in (commandline -opc) + if contains -- $i $__fish_kubectl_commands + echo "$i" + return 1 + end + end + return 0 +end + +function __fish_kubectl_needs_resource -d 'Test if kubectl has yet to be given the subcommand resource' + set -l resources (__fish_kubectl_print_resource_types) + for i in (commandline -opc) + if contains -- $i $resources + return 1 + end + end + return 0 +end + +function __fish_kubectl_using_command + set -l cmd (__fish_kubectl_needs_command) + test -z "$cmd" + and return 1 + + contains -- $cmd $argv + and echo "$cmd" + and return 0 + + return 1 +end + +function __fish_kubectl_using_resource + set -l cmd (__fish_kubectl_needs_resource) + test -z "$cmd" + and return 1 + + contains -- $cmd $argv + and echo "$cmd" + and return 0 + + return 1 +end + +function __fish_kubectl_has_partial_resource_match + set -l last (commandline -opt) + if not set -l matches (string match -- "(.*)/" $last) + return + end + + if string match -q -- "(.*)/" $last + return 0 + end + + return 1 +end + +function __fish_kubectl_print_matching_resources + set -l last (commandline -opt) + if not set -l matches (string match -r -- "(.*)/" $last) + return + end + set -l prefix $matches[2] + set -l resources (__fish_kubectl_print_resource "$prefix") + for i in $resources + echo "$prefix/$i" + end +end + +function __fish_kubectl_get_context_flags + set -l cmd (commandline -opc) + if [ (count $cmd) -eq 0 ] + return 1 + end + + set -l foundContext 0 + + for c in $cmd + test $foundContext -eq 1 + set -l out "--context" "$c" + and echo $out + and return 0 + + if string match -q -r -- "--context=" "$c" + set -l out (string split -- "=" "$c" | string join " ") + and echo $out + and return 0 + else if contains -- "$c" "--context" + set foundContext 1 + end + end + + return 1 +end + +function __fish_kubectl_get_kubeconfig_flags + set -l cmd (commandline -opc) + if [ (count $cmd) -eq 0 ] + return 1 + end + + set -l foundKubeconfig 0 + + for c in $cmd + test $foundKubeconfig -eq 1 + set -l out "--kubeconfig" "$c" + and echo $out + and return 0 + + if string match -q -r -- "--kubeconfig=" "$c" + set -l out (string split -- "=" "$c" | string join " ") + and echo $out + and return 0 + else if contains -- "$c" "--kubeconfig" + set foundKubeconfig 1 + end + end + + return 1 +end + +function __fish_kubectl_get_ns_flags + set -l cmd (commandline -opc) + if [ (count $cmd) -eq 0 ] + return 1 + end + + set -l foundNamespace 0 + + for c in $cmd + test $foundNamespace -eq 1 + set -l out "--namespace" "$c" + and echo $out + and return 0 + + if contains -- $c $__kubectl_all_namespaces_flags + echo "--all-namespaces" + return 0 + end + + if contains -- $c "--namespace" "-n" + set foundNamespace 1 + end + end + + return 1 +end + +function __fish_kubectl_print_resource_types + for r in $__fish_kubectl_resources + echo $r + end + + if test $FISH_KUBECTL_COMPLETION_COMPLETE_CRDS -eq 1 + set -l crds (__fish_kubectl_get_crds) + + for r in $crds + echo $r + end + end +end + +function __fish_kubectl_print_current_resources -d 'Prints current resources' + set -l found 0 + # There is probably a better way to do this... + # found === 1 means that we have not yet found the crd type + # found === 2 means that we have not yet found the crd name, but have found the type + set -l current_resource + set -l crd_types (__fish_kubectl_get_crds) + for i in (commandline -opc) + if test $found -eq 0 + if contains -- $i $__fish_kubectl_subresource_commands + set found 1 + end + end + + if test $found -eq 1 + if contains -- $i $crd_types + set -l out (__fish_kubectl_print_resource $i) + for item in $out + echo "$item" + end + return 0 + end + end + end +end + +function __fish_kubectl_print_resource -d 'Print a list of resources' -a resource + set -l args + if set -l ns_flags (__fish_kubectl_get_ns_flags | string split " ") + for ns in $ns_flags + set args $args $ns + end + end + + set args $args get "$resource" + __fish_kubectl $args --no-headers 2>/dev/null | awk '{print $1}' | string replace -r '(.*)/' '' +end + +function __fish_kubectl_get_config -a type + set -l template "{{ range .$type }}"'{{ .name }}{{"\n"}}{{ end }}' + __fish_kubectl config view -o template --template="$template" +end + +function __fish_kubectl_get_rollout_resources + set -l args + if set -l ns_flags (__fish_kubectl_get_ns_flags | string split " ") + for ns in $ns_flags + set args $args $ns + end + end + + set -l template '{range .items[*]}{.metadata.name}{"\n"}{end}' + + set -l deploys (__fish_kubectl $args get deploy -o jsonpath="$template" 2>/dev/null) + set -l daemonsets (__fish_kubectl $args get ds -o jsonpath="$template" 2>/dev/null) + set -l sts (__fish_kubectl $args get sts -o jsonpath="$template" 2>/dev/null) + + for i in $deploys + echo "deploy/$i" + echo "deployment/$i" + echo "deployments/$i" + end + + for i in $daemonsets + echo "daemonset/$i" + echo "daemonsets/$i" + echo "ds/$i" + end + + for i in $sts + echo "statefulset/$i" + echo "statefulsets/$i" + echo "sts/$i" + end +end + +complete -c kubectl -f -n '__fish_kubectl_needs_command' -a '(__fish_kubectl_get_commands)' + +for subcmd in $__fish_kubectl_subresource_commands + complete -c kubectl -f -n "__fish_kubectl_using_command $subcmd; and not __fish_seen_subcommand_from (__fish_kubectl_print_resource_types)" -a '(__fish_kubectl_print_resource_types)' -d 'Resource' + complete -c kubectl -f -n "__fish_kubectl_using_command $subcmd; and __fish_kubectl_has_partial_resource_match" -a '(__fish_kubectl_print_matching_resources)' -d 'Resource' + for resource in $__fish_kubectl_resources + complete -c kubectl -f -n "__fish_kubectl_using_command $subcmd; and __fish_seen_subcommand_from $resource" -a "(__fish_kubectl_print_resource $resource)" -d "$resource" + end + + if test $FISH_KUBECTL_COMPLETION_COMPLETE_CRDS -eq 1 + complete -c kubectl -f -n "__fish_kubectl_using_command $subcmd; and __fish_seen_subcommand_from (__fish_kubectl_get_crds)" -a '(__fish_kubectl_print_current_resources)' -d 'CRD' + end +end + +complete -c kubectl -f -n "__fish_seen_subcommand_from log logs exec port-forward" -a '(__fish_kubectl_print_resource pods)' -d 'Pod' +complete -c kubectl -f -n "__fish_seen_subcommand_from top; and __fish_seen_subcommand_from po pod pods" -a '(__fish_kubectl_print_resource pods)' -d 'Pod' +complete -c kubectl -f -n "__fish_seen_subcommand_from top; and __fish_seen_subcommand_from no node nodes" -a '(__fish_kubectl_print_resource nodes)' -d 'Node' + +for subcmd in cordon uncordon drain taint + complete -c kubectl -f -n "__fish_seen_subcommand_from $subcmd" -a '(__fish_kubectl_print_resource nodes)' -d 'Node' +end + +set -l __fish_kubectl_config_complete_contexts \ + delete-context \ + get-contexts \ + rename-contexts \ + set-context \ + use-context + +set -l __fish_kubectl_config_complete_clusters \ + delete-cluster \ + get-clusters \ + set-cluster + +complete -c kubectl -f -n "__fish_seen_subcommand_from config; and __fish_seen_subcommand_from $__fish_kubectl_config_complete_contexts" -a '(__fish_kubectl_get_config contexts)' -d 'Context' +complete -c kubectl -f -n "__fish_seen_subcommand_from config; and __fish_seen_subcommand_from $__fish_kubectl_config_complete_clusters" -a '(__fish_kubectl_get_config clusters)' -d 'Cluster' +complete -c kubectl -f -n "__fish_seen_subcommand_from rollout; and __fish_seen_subcommand_from (__fish_kubectl_get_rollout_commands_without_descriptions)" -a '(__fish_kubectl_get_rollout_resources)' +complete -c kubectl -f -r -l as -d 'Username to impersonate for the operation' +complete -c kubectl -f -r -l as-group -d 'Group to impersonate for the operation, this flag can be repeated to specify multiple groups.' +complete -c kubectl -r -l cache-dir -d 'Default cache directory' +complete -c kubectl -r -l certificate-authority -d 'Path to a cert file for the certificate authority' +complete -c kubectl -r -l client-certificate -d 'Path to a client certificate file for TLS' +complete -c kubectl -r -l client-key -d 'Path to a client key file for TLS' +complete -c kubectl -f -r -l cluster -d 'The name of the kubeconfig cluster to use' -a '(__fish_kubectl_get_config clusters)' +complete -c kubectl -f -r -l context -d 'The name of the kubeconfig context to use' -a '(__fish_kubectl_get_config contexts)' +complete -c kubectl -f -l insecure-skip-tls-verify -d 'If true, the server\'s certificate will not be checked for validity. This will make your HTTPS connections insecure' +complete -c kubectl -r -l kubeconfig -d 'Path to the kubeconfig file to use for CLI requests.' +complete -c kubectl -f -l match-server-version -d 'Require server version to match client version' +complete -c kubectl -f -r -s n -l namespace -d 'If present, the namespace scope for this CLI request' -a '(__fish_kubectl_print_resource namespace)' +complete -c kubectl -f -r -l password -d 'Password for basic authentication to the API server' +complete -c kubectl -f -r -l profile -d 'Name of profile to capture. One of (none|cpu|heap|goroutine|threadcreate|block|mutex)' +complete -c kubectl -f -r -l profile-output -d 'Name of the file to write the profile to' +complete -c kubectl -f -r -l request-timeout -d 'The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don\'t timeout requests.' +complete -c kubectl -f -r -s s -l server -d 'The address and port of the Kubernetes API server' +complete -c kubectl -f -r -l tls-server-name -d 'Server name to use for server certificate validation. If it is not provided, the hostname used to contact the server is used' +complete -c kubectl -f -r -l token -d 'Bearer token for authentication to the API server' +complete -c kubectl -f -r -l user -d 'The name of the kubeconfig user to use' -a '(__fish_kubectl_get_config users)' +complete -c kubectl -f -r -l username -d 'Username for basic authentication to the API server' +complete -c kubectl -f -l warnings-as-errors -d 'Treat warnings received from the server as errors and exit with a non-zero exit code' + +# Completions for the "kubectl alpha" command +function __fish_kubectl_get_alpha_commands + echo debug\t'Create debugging sessions for troubleshooting workloads and nodes' +end + +function __fish_kubectl_get_alpha_commands_without_descriptions + __fish_kubectl_get_alpha_commands | string replace -r '\t.*$' '' +end + +complete -c kubectl -f -n "__fish_kubectl_using_command alpha; and not __fish_seen_subcommand_from (__fish_kubectl_get_alpha_commands_without_descriptions)" -a '(__fish_kubectl_get_alpha_commands)' + +# Completions for the "kubectl alpha debug" command +complete -c kubectl -f -n '__fish_seen_subcommand_from alpha debug' -l arguments-only -d 'If specified, everything after -- will be passed to the new container as Args instead of Command.' +complete -c kubectl -f -n '__fish_seen_subcommand_from alpha debug' -l attach -d 'If true, wait for the container to start running, and then attach as if \'kubectl attach ...\' were called. Default false, unless \'-i/--stdin\' is set, in which case the default is true.' +complete -c kubectl -f -n '__fish_seen_subcommand_from alpha debug' -r -s c -l container -d 'Container name to use for debug container.' +complete -c kubectl -f -n '__fish_seen_subcommand_from alpha debug' -r -l copy-to -d 'Create a copy of the target Pod with this name.' +complete -c kubectl -f -n '__fish_seen_subcommand_from alpha debug' -r -l env -d 'Environment variables to set in the container.' +complete -c kubectl -f -n '__fish_seen_subcommand_from alpha debug' -r -l image -d 'Container image to use for debug container.' +complete -c kubectl -f -n '__fish_seen_subcommand_from alpha debug' -r -l image-pull-policy -d 'The image pull policy for the container. If left empty, this value will not be specified by the client and defaulted by the server.' +complete -c kubectl -f -n '__fish_seen_subcommand_from alpha debug' -l quiet -d 'If true, suppress informational messages.' +complete -c kubectl -f -n '__fish_seen_subcommand_from alpha debug' -l replace -d 'When used with \'--copy-to\', delete the original Pod.' +complete -c kubectl -f -n '__fish_seen_subcommand_from alpha debug' -l same-node -d 'When used with \'--copy-to\', schedule the copy of target Pod on the same node.' +complete -c kubectl -f -n '__fish_seen_subcommand_from alpha debug' -r -l set-image -d 'When used with \'--copy-to\', a list of name=image pairs for changing container images, similar to how \'kubectl set image\' works.' +complete -c kubectl -f -n '__fish_seen_subcommand_from alpha debug' -l share-processes -d 'When used with \'--copy-to\', enable process namespace sharing in the copy.' +complete -c kubectl -f -n '__fish_seen_subcommand_from alpha debug' -s i -l stdin -d 'Keep stdin open on the container(s) in the pod, even if nothing is attached.' +complete -c kubectl -f -n '__fish_seen_subcommand_from alpha debug' -r -l target -d 'When using an ephemeral container, target processes in this container name.' +complete -c kubectl -f -n '__fish_seen_subcommand_from alpha debug' -s t -l tty -d 'Allocate a TTY for the debugging container.' + +# Completions for the "kubectl annotate" command +complete -c kubectl -f -n '__fish_seen_subcommand_from annotate' -l all -d 'Select all resources, including uninitialized ones, in the namespace of the specified resource types.' +complete -c kubectl -f -n '__fish_seen_subcommand_from annotate' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from annotate' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from annotate' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -f -n '__fish_seen_subcommand_from annotate' -r -l field-selector -d 'Selector (field query) to filter on, supports \'=\', \'==\', and \'!=\'.(e.g. --field-selector key1=value1,key2=value2). The server only supports a limited number of field queries per type.' +complete -c kubectl -n '__fish_seen_subcommand_from annotate' -r -s f -l filename -d 'Filename, directory, or URL to files identifying the resource to update the annotation' +complete -c kubectl -f -n '__fish_seen_subcommand_from annotate' -r -s k -l kustomize -d 'Process the kustomization directory. This flag can\'t be used together with -f or -R.' +complete -c kubectl -f -n '__fish_seen_subcommand_from annotate' -l list -d 'If true, display the annotations for a given resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from annotate' -l local -d 'If true, annotation will NOT contact api-server but run locally.' +complete -c kubectl -f -n '__fish_seen_subcommand_from annotate' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from annotate' -l overwrite -d 'If true, allow annotations to be overwritten, otherwise reject annotation updates that overwrite existing annotations.' +complete -c kubectl -f -n '__fish_seen_subcommand_from annotate' -l record -d 'Record current kubectl command in the resource annotation. If set to false, do not record the command. If set to true, record the command. If not set, default to updating the existing annotation value only if one already exists.' +complete -c kubectl -f -n '__fish_seen_subcommand_from annotate' -s R -l recursive -d 'Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.' +complete -c kubectl -f -n '__fish_seen_subcommand_from annotate' -r -l resource-version -d 'If non-empty, the annotation update will only succeed if this is the current resource-version for the object. Only valid when specifying a single resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from annotate' -r -s l -l selector -d 'Selector (label query) to filter on, not including uninitialized ones, supports \'=\', \'==\', and \'!=\'.(e.g. -l key1=value1,key2=value2).' +complete -c kubectl -n '__fish_seen_subcommand_from annotate' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' + +# Completions for the "kubectl api-resources" command +complete -c kubectl -f -n '__fish_seen_subcommand_from api-resources' -r -l api-group -d 'Limit to resources in the specified API group.' +complete -c kubectl -f -n '__fish_seen_subcommand_from api-resources' -l cached -d 'Use the cached list of resources if available.' +complete -c kubectl -f -n '__fish_seen_subcommand_from api-resources' -l namespaced -d 'If false, non-namespaced resources will be returned, otherwise returning namespaced resources by default.' +complete -c kubectl -f -n '__fish_seen_subcommand_from api-resources' -l no-headers -d 'When using the default or custom-column output format, don\'t print headers (default print headers).' +complete -c kubectl -f -n '__fish_seen_subcommand_from api-resources' -r -s o -l output -d 'Output format. One of: wide|name.' +complete -c kubectl -f -n '__fish_seen_subcommand_from api-resources' -r -l sort-by -d 'If non-empty, sort list of resources using specified field. The field can be either \'name\' or \'kind\'.' +complete -c kubectl -f -n '__fish_seen_subcommand_from api-resources' -r -l verbs -d 'Limit to resources that support the specified verbs.' + +# Completions for the "kubectl apply" command +complete -c kubectl -f -n '__fish_seen_subcommand_from apply' -l all -d 'Select all resources in the namespace of the specified resource types.' +complete -c kubectl -f -n '__fish_seen_subcommand_from apply' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from apply' -r -l cascade -d 'Must be "background", "orphan", or "foreground". Selects the deletion cascading strategy for the dependents (e.g. Pods created by a ReplicationController). Defaults to background.' +complete -c kubectl -f -n '__fish_seen_subcommand_from apply' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from apply' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -n '__fish_seen_subcommand_from apply' -r -s f -l filename -d 'that contains the configuration to apply' +complete -c kubectl -f -n '__fish_seen_subcommand_from apply' -l force -d 'If true, immediately remove resources from API and bypass graceful deletion. Note that immediate deletion of some resources may result in inconsistency or data loss and requires confirmation.' +complete -c kubectl -f -n '__fish_seen_subcommand_from apply' -l force-conflicts -d 'If true, server-side apply will force the changes against conflicts.' +complete -c kubectl -f -n '__fish_seen_subcommand_from apply' -r -l grace-period -d 'Period of time in seconds given to the resource to terminate gracefully. Ignored if negative. Set to 1 for immediate shutdown. Can only be set to 0 when --force is true (force deletion).' +complete -c kubectl -f -n '__fish_seen_subcommand_from apply' -r -s k -l kustomize -d 'Process a kustomization directory. This flag can\'t be used together with -f or -R.' +complete -c kubectl -f -n '__fish_seen_subcommand_from apply' -l openapi-patch -d 'If true, use openapi to calculate diff when the openapi presents and the resource can be found in the openapi spec. Otherwise, fall back to use baked-in types.' +complete -c kubectl -f -n '__fish_seen_subcommand_from apply' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from apply' -l overwrite -d 'Automatically resolve conflicts between the modified and live configuration by using values from the modified configuration' +complete -c kubectl -f -n '__fish_seen_subcommand_from apply' -l prune -d 'Automatically delete resource objects, including the uninitialized ones, that do not appear in the configs and are created by either apply or create --save-config. Should be used with either -l or --all.' +complete -c kubectl -f -n '__fish_seen_subcommand_from apply' -r -l prune-whitelist -d 'Overwrite the default whitelist with for --prune' +complete -c kubectl -f -n '__fish_seen_subcommand_from apply' -l record -d 'Record current kubectl command in the resource annotation. If set to false, do not record the command. If set to true, record the command. If not set, default to updating the existing annotation value only if one already exists.' +complete -c kubectl -f -n '__fish_seen_subcommand_from apply' -s R -l recursive -d 'Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.' +complete -c kubectl -f -n '__fish_seen_subcommand_from apply' -r -s l -l selector -d 'Selector (label query) to filter on, supports \'=\', \'==\', and \'!=\'.(e.g. -l key1=value1,key2=value2)' +complete -c kubectl -f -n '__fish_seen_subcommand_from apply' -l server-side -d 'If true, apply runs in the server instead of the client.' +complete -c kubectl -n '__fish_seen_subcommand_from apply' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' +complete -c kubectl -f -n '__fish_seen_subcommand_from apply' -r -l timeout -d 'The length of time to wait before giving up on a delete, zero means determine a timeout from the size of the object' +complete -c kubectl -f -n '__fish_seen_subcommand_from apply' -l validate -d 'If true, use a schema to validate the input before sending it' +complete -c kubectl -f -n '__fish_seen_subcommand_from apply' -l wait -d 'If true, wait for resources to be gone before returning. This waits for finalizers.' +function __fish_kubectl_get_apply_commands + echo edit-last-applied\t'Edit latest last-applied-configuration annotations of a resource/object' + echo set-last-applied\t'Set the last-applied-configuration annotation on a live object to match the contents of a file.' + echo view-last-applied\t'View latest last-applied-configuration annotations of a resource/object' +end + +function __fish_kubectl_get_apply_commands_without_descriptions + __fish_kubectl_get_apply_commands | string replace -r '\t.*$' '' +end + +complete -c kubectl -f -n "__fish_kubectl_using_command apply; and not __fish_seen_subcommand_from (__fish_kubectl_get_apply_commands_without_descriptions)" -a '(__fish_kubectl_get_apply_commands)' + +# Completions for the "kubectl apply edit-last-applied" command +complete -c kubectl -f -n '__fish_seen_subcommand_from apply edit-last-applied' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from apply edit-last-applied' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -n '__fish_seen_subcommand_from apply edit-last-applied' -r -s f -l filename -d 'Filename, directory, or URL to files to use to edit the resource' +complete -c kubectl -f -n '__fish_seen_subcommand_from apply edit-last-applied' -r -s k -l kustomize -d 'Process the kustomization directory. This flag can\'t be used together with -f or -R.' +complete -c kubectl -f -n '__fish_seen_subcommand_from apply edit-last-applied' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from apply edit-last-applied' -l record -d 'Record current kubectl command in the resource annotation. If set to false, do not record the command. If set to true, record the command. If not set, default to updating the existing annotation value only if one already exists.' +complete -c kubectl -f -n '__fish_seen_subcommand_from apply edit-last-applied' -s R -l recursive -d 'Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.' +complete -c kubectl -n '__fish_seen_subcommand_from apply edit-last-applied' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' +complete -c kubectl -f -n '__fish_seen_subcommand_from apply edit-last-applied' -l windows-line-endings -d 'Defaults to the line ending native to your platform.' + +# Completions for the "kubectl apply set-last-applied" command +complete -c kubectl -f -n '__fish_seen_subcommand_from apply set-last-applied' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from apply set-last-applied' -l create-annotation -d 'Will create \'last-applied-configuration\' annotations if current objects doesn\'t have one' +complete -c kubectl -f -n '__fish_seen_subcommand_from apply set-last-applied' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -n '__fish_seen_subcommand_from apply set-last-applied' -r -s f -l filename -d 'Filename, directory, or URL to files that contains the last-applied-configuration annotations' +complete -c kubectl -f -n '__fish_seen_subcommand_from apply set-last-applied' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -n '__fish_seen_subcommand_from apply set-last-applied' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' + +# Completions for the "kubectl apply view-last-applied" command +complete -c kubectl -f -n '__fish_seen_subcommand_from apply view-last-applied' -l all -d 'Select all resources in the namespace of the specified resource types' +complete -c kubectl -n '__fish_seen_subcommand_from apply view-last-applied' -r -s f -l filename -d 'Filename, directory, or URL to files that contains the last-applied-configuration annotations' +complete -c kubectl -f -n '__fish_seen_subcommand_from apply view-last-applied' -r -s k -l kustomize -d 'Process the kustomization directory. This flag can\'t be used together with -f or -R.' +complete -c kubectl -f -n '__fish_seen_subcommand_from apply view-last-applied' -r -s o -l output -d 'Output format. Must be one of yaml|json' +complete -c kubectl -f -n '__fish_seen_subcommand_from apply view-last-applied' -s R -l recursive -d 'Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.' +complete -c kubectl -f -n '__fish_seen_subcommand_from apply view-last-applied' -r -s l -l selector -d 'Selector (label query) to filter on, supports \'=\', \'==\', and \'!=\'.(e.g. -l key1=value1,key2=value2)' + +# Completions for the "kubectl attach" command +complete -c kubectl -f -n '__fish_seen_subcommand_from attach' -r -s c -l container -d 'Container name. If omitted, the first container in the pod will be chosen' +complete -c kubectl -f -n '__fish_seen_subcommand_from attach' -r -l pod-running-timeout -d 'The length of time (like 5s, 2m, or 3h, higher than zero) to wait until at least one pod is running' +complete -c kubectl -f -n '__fish_seen_subcommand_from attach' -s i -l stdin -d 'Pass stdin to the container' +complete -c kubectl -f -n '__fish_seen_subcommand_from attach' -s t -l tty -d 'Stdin is a TTY' + +# Completions for the "kubectl auth" command +function __fish_kubectl_get_auth_commands + echo can-i\t'Check whether an action is allowed' + echo reconcile\t'Reconciles rules for RBAC Role, RoleBinding, ClusterRole, and ClusterRole binding objects' +end + +function __fish_kubectl_get_auth_commands_without_descriptions + __fish_kubectl_get_auth_commands | string replace -r '\t.*$' '' +end + +complete -c kubectl -f -n "__fish_kubectl_using_command auth; and not __fish_seen_subcommand_from (__fish_kubectl_get_auth_commands_without_descriptions)" -a '(__fish_kubectl_get_auth_commands)' + +# Completions for the "kubectl auth can-i" command +complete -c kubectl -f -n '__fish_seen_subcommand_from auth can-i' -s A -l all-namespaces -d 'If true, check the specified action in all namespaces.' +complete -c kubectl -f -n '__fish_seen_subcommand_from auth can-i' -l list -d 'If true, prints all allowed actions.' +complete -c kubectl -f -n '__fish_seen_subcommand_from auth can-i' -l no-headers -d 'If true, prints allowed actions without headers' +complete -c kubectl -f -n '__fish_seen_subcommand_from auth can-i' -s q -l quiet -d 'If true, suppress output and just return the exit code.' +complete -c kubectl -f -n '__fish_seen_subcommand_from auth can-i' -r -l subresource -d 'SubResource such as pod/log or deployment/scale' + +# Completions for the "kubectl auth reconcile" command +complete -c kubectl -f -n '__fish_seen_subcommand_from auth reconcile' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from auth reconcile' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -n '__fish_seen_subcommand_from auth reconcile' -r -s f -l filename -d 'Filename, directory, or URL to files identifying the resource to reconcile.' +complete -c kubectl -f -n '__fish_seen_subcommand_from auth reconcile' -r -s k -l kustomize -d 'Process the kustomization directory. This flag can\'t be used together with -f or -R.' +complete -c kubectl -f -n '__fish_seen_subcommand_from auth reconcile' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from auth reconcile' -s R -l recursive -d 'Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.' +complete -c kubectl -f -n '__fish_seen_subcommand_from auth reconcile' -l remove-extra-permissions -d 'If true, removes extra permissions added to roles' +complete -c kubectl -f -n '__fish_seen_subcommand_from auth reconcile' -l remove-extra-subjects -d 'If true, removes extra subjects added to rolebindings' +complete -c kubectl -n '__fish_seen_subcommand_from auth reconcile' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' + +# Completions for the "kubectl autoscale" command +complete -c kubectl -f -n '__fish_seen_subcommand_from autoscale' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from autoscale' -r -l cpu-percent -d 'The target average CPU utilization (represented as a percent of requested CPU) over all the pods. If it\'s not specified or negative, a default autoscaling policy will be used.' +complete -c kubectl -f -n '__fish_seen_subcommand_from autoscale' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from autoscale' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -n '__fish_seen_subcommand_from autoscale' -r -s f -l filename -d 'Filename, directory, or URL to files identifying the resource to autoscale.' +complete -c kubectl -f -n '__fish_seen_subcommand_from autoscale' -r -s k -l kustomize -d 'Process the kustomization directory. This flag can\'t be used together with -f or -R.' +complete -c kubectl -f -n '__fish_seen_subcommand_from autoscale' -r -l max -d 'The upper limit for the number of pods that can be set by the autoscaler. Required.' +complete -c kubectl -f -n '__fish_seen_subcommand_from autoscale' -r -l min -d 'The lower limit for the number of pods that can be set by the autoscaler. If it\'s not specified or negative, the server will apply a default value.' +complete -c kubectl -f -n '__fish_seen_subcommand_from autoscale' -r -l name -d 'The name for the newly created object. If not specified, the name of the input resource will be used.' +complete -c kubectl -f -n '__fish_seen_subcommand_from autoscale' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from autoscale' -l record -d 'Record current kubectl command in the resource annotation. If set to false, do not record the command. If set to true, record the command. If not set, default to updating the existing annotation value only if one already exists.' +complete -c kubectl -f -n '__fish_seen_subcommand_from autoscale' -s R -l recursive -d 'Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.' +complete -c kubectl -f -n '__fish_seen_subcommand_from autoscale' -l save-config -d 'If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.' +complete -c kubectl -n '__fish_seen_subcommand_from autoscale' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' + +# Completions for the "kubectl certificate" command +function __fish_kubectl_get_certificate_commands + echo approve\t'Approve a certificate signing request' + echo deny\t'Deny a certificate signing request' +end + +function __fish_kubectl_get_certificate_commands_without_descriptions + __fish_kubectl_get_certificate_commands | string replace -r '\t.*$' '' +end + +complete -c kubectl -f -n "__fish_kubectl_using_command certificate; and not __fish_seen_subcommand_from (__fish_kubectl_get_certificate_commands_without_descriptions)" -a '(__fish_kubectl_get_certificate_commands)' + +# Completions for the "kubectl certificate approve" command +complete -c kubectl -f -n '__fish_seen_subcommand_from certificate approve' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -n '__fish_seen_subcommand_from certificate approve' -r -s f -l filename -d 'Filename, directory, or URL to files identifying the resource to update' +complete -c kubectl -f -n '__fish_seen_subcommand_from certificate approve' -l force -d 'Update the CSR even if it is already approved.' +complete -c kubectl -f -n '__fish_seen_subcommand_from certificate approve' -r -s k -l kustomize -d 'Process the kustomization directory. This flag can\'t be used together with -f or -R.' +complete -c kubectl -f -n '__fish_seen_subcommand_from certificate approve' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from certificate approve' -s R -l recursive -d 'Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.' +complete -c kubectl -n '__fish_seen_subcommand_from certificate approve' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' + +# Completions for the "kubectl certificate deny" command +complete -c kubectl -f -n '__fish_seen_subcommand_from certificate deny' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -n '__fish_seen_subcommand_from certificate deny' -r -s f -l filename -d 'Filename, directory, or URL to files identifying the resource to update' +complete -c kubectl -f -n '__fish_seen_subcommand_from certificate deny' -l force -d 'Update the CSR even if it is already denied.' +complete -c kubectl -f -n '__fish_seen_subcommand_from certificate deny' -r -s k -l kustomize -d 'Process the kustomization directory. This flag can\'t be used together with -f or -R.' +complete -c kubectl -f -n '__fish_seen_subcommand_from certificate deny' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from certificate deny' -s R -l recursive -d 'Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.' +complete -c kubectl -n '__fish_seen_subcommand_from certificate deny' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' + +# Completions for the "kubectl cluster-info" command +function __fish_kubectl_get_cluster_info_commands + echo dump\t'Dump lots of relevant info for debugging and diagnosis' +end + +function __fish_kubectl_get_cluster_info_commands_without_descriptions + __fish_kubectl_get_cluster_info_commands | string replace -r '\t.*$' '' +end + +complete -c kubectl -f -n "__fish_kubectl_using_command cluster-info; and not __fish_seen_subcommand_from (__fish_kubectl_get_cluster_info_commands_without_descriptions)" -a '(__fish_kubectl_get_cluster_info_commands)' + +# Completions for the "kubectl cluster-info dump" command +complete -c kubectl -f -n '__fish_seen_subcommand_from cluster-info dump' -s A -l all-namespaces -d 'If true, dump all namespaces. If true, --namespaces is ignored.' +complete -c kubectl -f -n '__fish_seen_subcommand_from cluster-info dump' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from cluster-info dump' -r -l namespaces -d 'A comma separated list of namespaces to dump.' +complete -c kubectl -f -n '__fish_seen_subcommand_from cluster-info dump' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from cluster-info dump' -r -l output-directory -d 'Where to output the files. If empty or \'-\' uses stdout, otherwise creates a directory hierarchy in that directory' +complete -c kubectl -f -n '__fish_seen_subcommand_from cluster-info dump' -r -l pod-running-timeout -d 'The length of time (like 5s, 2m, or 3h, higher than zero) to wait until at least one pod is running' +complete -c kubectl -n '__fish_seen_subcommand_from cluster-info dump' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' + +# Completions for the "kubectl config" command +function __fish_kubectl_get_config_commands + echo current-context\t'Displays the current-context' + echo delete-cluster\t'Delete the specified cluster from the kubeconfig' + echo delete-context\t'Delete the specified context from the kubeconfig' + echo delete-user\t'Delete the specified user from the kubeconfig' + echo get-clusters\t'Display clusters defined in the kubeconfig' + echo get-contexts\t'Describe one or many contexts' + echo get-users\t'Display users defined in the kubeconfig' + echo rename-context\t'Renames a context from the kubeconfig file.' + echo set\t'Sets an individual value in a kubeconfig file' + echo set-cluster\t'Sets a cluster entry in kubeconfig' + echo set-context\t'Sets a context entry in kubeconfig' + echo set-credentials\t'Sets a user entry in kubeconfig' + echo unset\t'Unsets an individual value in a kubeconfig file' + echo use-context\t'Sets the current-context in a kubeconfig file' + echo use\t'Sets the current-context in a kubeconfig file' + echo view\t'Display merged kubeconfig settings or a specified kubeconfig file' +end + +function __fish_kubectl_get_config_commands_without_descriptions + __fish_kubectl_get_config_commands | string replace -r '\t.*$' '' +end + +complete -c kubectl -f -n "__fish_kubectl_using_command config; and not __fish_seen_subcommand_from (__fish_kubectl_get_config_commands_without_descriptions)" -a '(__fish_kubectl_get_config_commands)' + +# Completions for the "kubectl config get-contexts" command +complete -c kubectl -f -n '__fish_seen_subcommand_from config get-contexts' -l no-headers -d 'When using the default or custom-column output format, don\'t print headers (default print headers).' +complete -c kubectl -f -n '__fish_seen_subcommand_from config get-contexts' -r -s o -l output -d 'Output format. One of: name' + +# Completions for the "kubectl config set" command +complete -c kubectl -f -n '__fish_seen_subcommand_from config set' -r -l set-raw-bytes -d 'When writing a []byte PROPERTY_VALUE, write the given string directly without base64 decoding.' + +# Completions for the "kubectl config set-cluster" command +complete -c kubectl -f -n '__fish_seen_subcommand_from config set-cluster' -r -l embed-certs -d 'embed-certs for the cluster entry in kubeconfig' + +# Completions for the "kubectl config set-context" command +complete -c kubectl -f -n '__fish_seen_subcommand_from config set-context' -l current -d 'Modify the current context' + +# Completions for the "kubectl config set-credentials" command +complete -c kubectl -f -n '__fish_seen_subcommand_from config set-credentials' -r -l auth-provider -d 'Auth provider for the user entry in kubeconfig' +complete -c kubectl -f -n '__fish_seen_subcommand_from config set-credentials' -r -l auth-provider-arg -d '\'key=value\' arguments for the auth provider' +complete -c kubectl -f -n '__fish_seen_subcommand_from config set-credentials' -r -l embed-certs -d 'Embed client cert/key for the user entry in kubeconfig' +complete -c kubectl -f -n '__fish_seen_subcommand_from config set-credentials' -r -l exec-api-version -d 'API version of the exec credential plugin for the user entry in kubeconfig' +complete -c kubectl -f -n '__fish_seen_subcommand_from config set-credentials' -r -l exec-arg -d 'New arguments for the exec credential plugin command for the user entry in kubeconfig' +complete -c kubectl -f -n '__fish_seen_subcommand_from config set-credentials' -r -l exec-command -d 'Command for the exec credential plugin for the user entry in kubeconfig' +complete -c kubectl -f -n '__fish_seen_subcommand_from config set-credentials' -r -l exec-env -d '\'key=value\' environment values for the exec credential plugin' + +# Completions for the "kubectl config view" command +complete -c kubectl -f -n '__fish_seen_subcommand_from config view' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from config view' -l flatten -d 'Flatten the resulting kubeconfig file into self-contained output (useful for creating portable kubeconfig files)' +complete -c kubectl -f -n '__fish_seen_subcommand_from config view' -r -l merge -d 'Merge the full hierarchy of kubeconfig files' +complete -c kubectl -f -n '__fish_seen_subcommand_from config view' -l minify -d 'Remove all information not used by current-context from the output' +complete -c kubectl -f -n '__fish_seen_subcommand_from config view' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from config view' -l raw -d 'Display raw byte data' +complete -c kubectl -n '__fish_seen_subcommand_from config view' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' + +# Completions for the "kubectl cordon" command +complete -c kubectl -f -n '__fish_seen_subcommand_from cordon' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from cordon' -r -s l -l selector -d 'Selector (label query) to filter on' + +# Completions for the "kubectl cp" command +complete -c kubectl -f -n '__fish_seen_subcommand_from cp' -r -s c -l container -d 'Container name. If omitted, the first container in the pod will be chosen' +complete -c kubectl -f -n '__fish_seen_subcommand_from cp' -l no-preserve -d 'The copied file/directory\'s ownership and permissions will not be preserved in the container' + +# Completions for the "kubectl create" command +complete -c kubectl -f -n '__fish_seen_subcommand_from create' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create' -l edit -d 'Edit the API resource before creating' +complete -c kubectl -f -n '__fish_seen_subcommand_from create' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -n '__fish_seen_subcommand_from create' -r -s f -l filename -d 'Filename, directory, or URL to files to use to create the resource' +complete -c kubectl -f -n '__fish_seen_subcommand_from create' -r -s k -l kustomize -d 'Process the kustomization directory. This flag can\'t be used together with -f or -R.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create' -r -l raw -d 'Raw URI to POST to the server. Uses the transport specified by the kubeconfig file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create' -l record -d 'Record current kubectl command in the resource annotation. If set to false, do not record the command. If set to true, record the command. If not set, default to updating the existing annotation value only if one already exists.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create' -s R -l recursive -d 'Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create' -l save-config -d 'If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create' -r -s l -l selector -d 'Selector (label query) to filter on, supports \'=\', \'==\', and \'!=\'.(e.g. -l key1=value1,key2=value2)' +complete -c kubectl -n '__fish_seen_subcommand_from create' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' +complete -c kubectl -f -n '__fish_seen_subcommand_from create' -l validate -d 'If true, use a schema to validate the input before sending it' +complete -c kubectl -f -n '__fish_seen_subcommand_from create' -l windows-line-endings -d 'Only relevant if --edit=true. Defaults to the line ending native to your platform.' +function __fish_kubectl_get_create_commands + echo clusterrole\t'Create a ClusterRole.' + echo clusterrolebinding\t'Create a ClusterRoleBinding for a particular ClusterRole' + echo configmap\t'Create a configmap from a local file, directory or literal value' + echo cm\t'Create a configmap from a local file, directory or literal value' + echo cronjob\t'Create a cronjob with the specified name.' + echo cj\t'Create a cronjob with the specified name.' + echo deployment\t'Create a deployment with the specified name.' + echo deploy\t'Create a deployment with the specified name.' + echo ingress\t'Create an ingress with the specified name.' + echo ing\t'Create an ingress with the specified name.' + echo job\t'Create a job with the specified name.' + echo namespace\t'Create a namespace with the specified name' + echo ns\t'Create a namespace with the specified name' + echo poddisruptionbudget\t'Create a pod disruption budget with the specified name.' + echo pdb\t'Create a pod disruption budget with the specified name.' + echo priorityclass\t'Create a priorityclass with the specified name.' + echo pc\t'Create a priorityclass with the specified name.' + echo quota\t'Create a quota with the specified name.' + echo resourcequota\t'Create a quota with the specified name.' + echo role\t'Create a role with single rule.' + echo rolebinding\t'Create a RoleBinding for a particular Role or ClusterRole' + echo secret\t'Create a secret using specified subcommand' + echo service\t'Create a service using specified subcommand.' + echo svc\t'Create a service using specified subcommand.' + echo serviceaccount\t'Create a service account with the specified name' + echo sa\t'Create a service account with the specified name' +end + +function __fish_kubectl_get_create_commands_without_descriptions + __fish_kubectl_get_create_commands | string replace -r '\t.*$' '' +end + +complete -c kubectl -f -n "__fish_kubectl_using_command create; and not __fish_seen_subcommand_from (__fish_kubectl_get_create_commands_without_descriptions)" -a '(__fish_kubectl_get_create_commands)' + +# Completions for the "kubectl create clusterrole" command +complete -c kubectl -f -n '__fish_seen_subcommand_from create clusterrole' -r -l aggregation-rule -d 'An aggregation label selector for combining ClusterRoles.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create clusterrole' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create clusterrole' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create clusterrole' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create clusterrole' -r -l non-resource-url -d 'A partial url that user should have access to.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create clusterrole' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create clusterrole' -r -l resource -d 'Resource that the rule applies to' +complete -c kubectl -f -n '__fish_seen_subcommand_from create clusterrole' -r -l resource-name -d 'Resource in the white list that the rule applies to, repeat this flag for multiple items' +complete -c kubectl -f -n '__fish_seen_subcommand_from create clusterrole' -l save-config -d 'If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.' +complete -c kubectl -n '__fish_seen_subcommand_from create clusterrole' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' +complete -c kubectl -f -n '__fish_seen_subcommand_from create clusterrole' -l validate -d 'If true, use a schema to validate the input before sending it' +complete -c kubectl -f -n '__fish_seen_subcommand_from create clusterrole' -r -l verb -d 'Verb that applies to the resources contained in the rule' + +# Completions for the "kubectl create clusterrolebinding" command +complete -c kubectl -f -n '__fish_seen_subcommand_from create clusterrolebinding' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create clusterrolebinding' -r -l clusterrole -d 'ClusterRole this ClusterRoleBinding should reference' +complete -c kubectl -f -n '__fish_seen_subcommand_from create clusterrolebinding' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create clusterrolebinding' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create clusterrolebinding' -r -l group -d 'Groups to bind to the clusterrole' +complete -c kubectl -f -n '__fish_seen_subcommand_from create clusterrolebinding' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create clusterrolebinding' -l save-config -d 'If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create clusterrolebinding' -r -l serviceaccount -d 'Service accounts to bind to the clusterrole, in the format :' +complete -c kubectl -n '__fish_seen_subcommand_from create clusterrolebinding' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' +complete -c kubectl -f -n '__fish_seen_subcommand_from create clusterrolebinding' -l validate -d 'If true, use a schema to validate the input before sending it' + +# Completions for the "kubectl create configmap" command +complete -c kubectl -f -n '__fish_seen_subcommand_from create configmap' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create cm' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create configmap' -l append-hash -d 'Append a hash of the configmap to its name.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create cm' -l append-hash -d 'Append a hash of the configmap to its name.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create configmap' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create cm' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create configmap' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create cm' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create configmap' -r -l from-env-file -d 'Specify the path to a file to read lines of key=val pairs to create a configmap (i.e. a Docker .env file).' +complete -c kubectl -f -n '__fish_seen_subcommand_from create cm' -r -l from-env-file -d 'Specify the path to a file to read lines of key=val pairs to create a configmap (i.e. a Docker .env file).' +complete -c kubectl -f -n '__fish_seen_subcommand_from create configmap' -r -l from-file -d 'Key file can be specified using its file path, in which case file basename will be used as configmap key, or optionally with a key and file path, in which case the given key will be used. Specifying a directory will iterate each named file in the directory whose basename is a valid configmap key.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create cm' -r -l from-file -d 'Key file can be specified using its file path, in which case file basename will be used as configmap key, or optionally with a key and file path, in which case the given key will be used. Specifying a directory will iterate each named file in the directory whose basename is a valid configmap key.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create configmap' -r -l from-literal -d 'Specify a key and literal value to insert in configmap (i.e. mykey=somevalue)' +complete -c kubectl -f -n '__fish_seen_subcommand_from create cm' -r -l from-literal -d 'Specify a key and literal value to insert in configmap (i.e. mykey=somevalue)' +complete -c kubectl -f -n '__fish_seen_subcommand_from create configmap' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create cm' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create configmap' -l save-config -d 'If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create cm' -l save-config -d 'If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.' +complete -c kubectl -n '__fish_seen_subcommand_from create configmap' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' +complete -c kubectl -n '__fish_seen_subcommand_from create cm' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' +complete -c kubectl -f -n '__fish_seen_subcommand_from create configmap' -l validate -d 'If true, use a schema to validate the input before sending it' +complete -c kubectl -f -n '__fish_seen_subcommand_from create cm' -l validate -d 'If true, use a schema to validate the input before sending it' + +# Completions for the "kubectl create cronjob" command +complete -c kubectl -f -n '__fish_seen_subcommand_from create cronjob' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create cj' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create cronjob' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create cj' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create cronjob' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create cj' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create cronjob' -r -l image -d 'Image name to run.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create cj' -r -l image -d 'Image name to run.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create cronjob' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create cj' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create cronjob' -r -l restart -d 'job\'s restart policy. supported values: OnFailure, Never' +complete -c kubectl -f -n '__fish_seen_subcommand_from create cj' -r -l restart -d 'job\'s restart policy. supported values: OnFailure, Never' +complete -c kubectl -f -n '__fish_seen_subcommand_from create cronjob' -l save-config -d 'If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create cj' -l save-config -d 'If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create cronjob' -r -l schedule -d 'A schedule in the Cron format the job should be run with.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create cj' -r -l schedule -d 'A schedule in the Cron format the job should be run with.' +complete -c kubectl -n '__fish_seen_subcommand_from create cronjob' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' +complete -c kubectl -n '__fish_seen_subcommand_from create cj' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' +complete -c kubectl -f -n '__fish_seen_subcommand_from create cronjob' -l validate -d 'If true, use a schema to validate the input before sending it' +complete -c kubectl -f -n '__fish_seen_subcommand_from create cj' -l validate -d 'If true, use a schema to validate the input before sending it' + +# Completions for the "kubectl create deployment" command +complete -c kubectl -f -n '__fish_seen_subcommand_from create deployment' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create deploy' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create deployment' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create deploy' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create deployment' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create deploy' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create deployment' -r -l image -d 'Image names to run.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create deploy' -r -l image -d 'Image names to run.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create deployment' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create deploy' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create deployment' -r -l port -d 'The port that this container exposes.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create deploy' -r -l port -d 'The port that this container exposes.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create deployment' -r -s r -l replicas -d 'Number of replicas to create. Default is 1.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create deploy' -r -s r -l replicas -d 'Number of replicas to create. Default is 1.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create deployment' -l save-config -d 'If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create deploy' -l save-config -d 'If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.' +complete -c kubectl -n '__fish_seen_subcommand_from create deployment' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' +complete -c kubectl -n '__fish_seen_subcommand_from create deploy' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' +complete -c kubectl -f -n '__fish_seen_subcommand_from create deployment' -l validate -d 'If true, use a schema to validate the input before sending it' +complete -c kubectl -f -n '__fish_seen_subcommand_from create deploy' -l validate -d 'If true, use a schema to validate the input before sending it' + +# Completions for the "kubectl create ingress" command +complete -c kubectl -f -n '__fish_seen_subcommand_from create ingress' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create ing' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create ingress' -r -l annotation -d 'Annotation to insert in the ingress object, in the format annotation=value' +complete -c kubectl -f -n '__fish_seen_subcommand_from create ing' -r -l annotation -d 'Annotation to insert in the ingress object, in the format annotation=value' +complete -c kubectl -f -n '__fish_seen_subcommand_from create ingress' -r -l class -d 'Ingress Class to be used' +complete -c kubectl -f -n '__fish_seen_subcommand_from create ing' -r -l class -d 'Ingress Class to be used' +complete -c kubectl -f -n '__fish_seen_subcommand_from create ingress' -r -l default-backend -d 'Default service for backend, in format of svcname:port' +complete -c kubectl -f -n '__fish_seen_subcommand_from create ing' -r -l default-backend -d 'Default service for backend, in format of svcname:port' +complete -c kubectl -f -n '__fish_seen_subcommand_from create ingress' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create ing' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create ingress' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create ing' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create ingress' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create ing' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create ingress' -r -l rule -d 'Rule in format host/path=service:port[,tls=secretname]. Paths containing the leading character \'*\' are considered pathType=Prefix. tls argument is optional.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create ing' -r -l rule -d 'Rule in format host/path=service:port[,tls=secretname]. Paths containing the leading character \'*\' are considered pathType=Prefix. tls argument is optional.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create ingress' -l save-config -d 'If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create ing' -l save-config -d 'If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.' +complete -c kubectl -n '__fish_seen_subcommand_from create ingress' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' +complete -c kubectl -n '__fish_seen_subcommand_from create ing' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' +complete -c kubectl -f -n '__fish_seen_subcommand_from create ingress' -l validate -d 'If true, use a schema to validate the input before sending it' +complete -c kubectl -f -n '__fish_seen_subcommand_from create ing' -l validate -d 'If true, use a schema to validate the input before sending it' + +# Completions for the "kubectl create job" command +complete -c kubectl -f -n '__fish_seen_subcommand_from create job' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create job' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create job' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create job' -r -l from -d 'The name of the resource to create a Job from (only cronjob is supported).' +complete -c kubectl -f -n '__fish_seen_subcommand_from create job' -r -l image -d 'Image name to run.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create job' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create job' -l save-config -d 'If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.' +complete -c kubectl -n '__fish_seen_subcommand_from create job' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' +complete -c kubectl -f -n '__fish_seen_subcommand_from create job' -l validate -d 'If true, use a schema to validate the input before sending it' + +# Completions for the "kubectl create namespace" command +complete -c kubectl -f -n '__fish_seen_subcommand_from create namespace' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create ns' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create namespace' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create ns' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create namespace' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create ns' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create namespace' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create ns' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create namespace' -l save-config -d 'If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create ns' -l save-config -d 'If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.' +complete -c kubectl -n '__fish_seen_subcommand_from create namespace' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' +complete -c kubectl -n '__fish_seen_subcommand_from create ns' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' +complete -c kubectl -f -n '__fish_seen_subcommand_from create namespace' -l validate -d 'If true, use a schema to validate the input before sending it' +complete -c kubectl -f -n '__fish_seen_subcommand_from create ns' -l validate -d 'If true, use a schema to validate the input before sending it' + +# Completions for the "kubectl create poddisruptionbudget" command +complete -c kubectl -f -n '__fish_seen_subcommand_from create poddisruptionbudget' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create pdb' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create poddisruptionbudget' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create pdb' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create poddisruptionbudget' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create pdb' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create poddisruptionbudget' -r -l max-unavailable -d 'The maximum number or percentage of unavailable pods this budget requires.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create pdb' -r -l max-unavailable -d 'The maximum number or percentage of unavailable pods this budget requires.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create poddisruptionbudget' -r -l min-available -d 'The minimum number or percentage of available pods this budget requires.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create pdb' -r -l min-available -d 'The minimum number or percentage of available pods this budget requires.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create poddisruptionbudget' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create pdb' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create poddisruptionbudget' -l save-config -d 'If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create pdb' -l save-config -d 'If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create poddisruptionbudget' -r -l selector -d 'A label selector to use for this budget. Only equality-based selector requirements are supported.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create pdb' -r -l selector -d 'A label selector to use for this budget. Only equality-based selector requirements are supported.' +complete -c kubectl -n '__fish_seen_subcommand_from create poddisruptionbudget' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' +complete -c kubectl -n '__fish_seen_subcommand_from create pdb' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' +complete -c kubectl -f -n '__fish_seen_subcommand_from create poddisruptionbudget' -l validate -d 'If true, use a schema to validate the input before sending it' +complete -c kubectl -f -n '__fish_seen_subcommand_from create pdb' -l validate -d 'If true, use a schema to validate the input before sending it' + +# Completions for the "kubectl create priorityclass" command +complete -c kubectl -f -n '__fish_seen_subcommand_from create priorityclass' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create pc' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create priorityclass' -r -l description -d 'description is an arbitrary string that usually provides guidelines on when this priority class should be used.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create pc' -r -l description -d 'description is an arbitrary string that usually provides guidelines on when this priority class should be used.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create priorityclass' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create pc' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create priorityclass' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create pc' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create priorityclass' -l global-default -d 'global-default specifies whether this PriorityClass should be considered as the default priority.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create pc' -l global-default -d 'global-default specifies whether this PriorityClass should be considered as the default priority.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create priorityclass' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create pc' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create priorityclass' -r -l preemption-policy -d 'preemption-policy is the policy for preempting pods with lower priority.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create pc' -r -l preemption-policy -d 'preemption-policy is the policy for preempting pods with lower priority.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create priorityclass' -l save-config -d 'If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create pc' -l save-config -d 'If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.' +complete -c kubectl -n '__fish_seen_subcommand_from create priorityclass' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' +complete -c kubectl -n '__fish_seen_subcommand_from create pc' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' +complete -c kubectl -f -n '__fish_seen_subcommand_from create priorityclass' -l validate -d 'If true, use a schema to validate the input before sending it' +complete -c kubectl -f -n '__fish_seen_subcommand_from create pc' -l validate -d 'If true, use a schema to validate the input before sending it' +complete -c kubectl -f -n '__fish_seen_subcommand_from create priorityclass' -r -l value -d 'the value of this priority class.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create pc' -r -l value -d 'the value of this priority class.' + +# Completions for the "kubectl create quota" command +complete -c kubectl -f -n '__fish_seen_subcommand_from create quota' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create resourcequota' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create quota' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create resourcequota' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create quota' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create resourcequota' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create quota' -r -l hard -d 'A comma-delimited set of resource=quantity pairs that define a hard limit.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create resourcequota' -r -l hard -d 'A comma-delimited set of resource=quantity pairs that define a hard limit.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create quota' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create resourcequota' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create quota' -l save-config -d 'If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create resourcequota' -l save-config -d 'If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create quota' -r -l scopes -d 'A comma-delimited set of quota scopes that must all match each object tracked by the quota.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create resourcequota' -r -l scopes -d 'A comma-delimited set of quota scopes that must all match each object tracked by the quota.' +complete -c kubectl -n '__fish_seen_subcommand_from create quota' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' +complete -c kubectl -n '__fish_seen_subcommand_from create resourcequota' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' +complete -c kubectl -f -n '__fish_seen_subcommand_from create quota' -l validate -d 'If true, use a schema to validate the input before sending it' +complete -c kubectl -f -n '__fish_seen_subcommand_from create resourcequota' -l validate -d 'If true, use a schema to validate the input before sending it' + +# Completions for the "kubectl create role" command +complete -c kubectl -f -n '__fish_seen_subcommand_from create role' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create role' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create role' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create role' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create role' -r -l resource -d 'Resource that the rule applies to' +complete -c kubectl -f -n '__fish_seen_subcommand_from create role' -r -l resource-name -d 'Resource in the white list that the rule applies to, repeat this flag for multiple items' +complete -c kubectl -f -n '__fish_seen_subcommand_from create role' -l save-config -d 'If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.' +complete -c kubectl -n '__fish_seen_subcommand_from create role' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' +complete -c kubectl -f -n '__fish_seen_subcommand_from create role' -l validate -d 'If true, use a schema to validate the input before sending it' +complete -c kubectl -f -n '__fish_seen_subcommand_from create role' -r -l verb -d 'Verb that applies to the resources contained in the rule' + +# Completions for the "kubectl create rolebinding" command +complete -c kubectl -f -n '__fish_seen_subcommand_from create rolebinding' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create rolebinding' -r -l clusterrole -d 'ClusterRole this RoleBinding should reference' +complete -c kubectl -f -n '__fish_seen_subcommand_from create rolebinding' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create rolebinding' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create rolebinding' -r -l group -d 'Groups to bind to the role' +complete -c kubectl -f -n '__fish_seen_subcommand_from create rolebinding' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create rolebinding' -r -l role -d 'Role this RoleBinding should reference' +complete -c kubectl -f -n '__fish_seen_subcommand_from create rolebinding' -l save-config -d 'If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create rolebinding' -r -l serviceaccount -d 'Service accounts to bind to the role, in the format :' +complete -c kubectl -n '__fish_seen_subcommand_from create rolebinding' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' +complete -c kubectl -f -n '__fish_seen_subcommand_from create rolebinding' -l validate -d 'If true, use a schema to validate the input before sending it' + +# Completions for the "kubectl create secret" command +function __fish_kubectl_get_create_secret_commands + echo docker-registry\t'Create a secret for use with a Docker registry' + echo generic\t'Create a secret from a local file, directory or literal value' + echo tls\t'Create a TLS secret' +end + +function __fish_kubectl_get_create_secret_commands_without_descriptions + __fish_kubectl_get_create_secret_commands | string replace -r '\t.*$' '' +end + +complete -c kubectl -f -n "__fish_kubectl_using_command secret; and not __fish_seen_subcommand_from (__fish_kubectl_get_create_secret_commands_without_descriptions)" -a '(__fish_kubectl_get_create_secret_commands)' + +# Completions for the "kubectl create secret docker-registry" command +complete -c kubectl -f -n '__fish_seen_subcommand_from create secret docker-registry' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create secret docker-registry' -l append-hash -d 'Append a hash of the secret to its name.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create secret docker-registry' -r -l docker-email -d 'Email for Docker registry' +complete -c kubectl -f -n '__fish_seen_subcommand_from create secret docker-registry' -r -l docker-password -d 'Password for Docker registry authentication' +complete -c kubectl -f -n '__fish_seen_subcommand_from create secret docker-registry' -r -l docker-server -d 'Server location for Docker registry' +complete -c kubectl -f -n '__fish_seen_subcommand_from create secret docker-registry' -r -l docker-username -d 'Username for Docker registry authentication' +complete -c kubectl -f -n '__fish_seen_subcommand_from create secret docker-registry' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create secret docker-registry' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create secret docker-registry' -r -l from-file -d 'Key files can be specified using their file path, in which case a default name will be given to them, or optionally with a name and file path, in which case the given name will be used. Specifying a directory will iterate each named file in the directory that is a valid secret key.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create secret docker-registry' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create secret docker-registry' -l save-config -d 'If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.' +complete -c kubectl -n '__fish_seen_subcommand_from create secret docker-registry' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' +complete -c kubectl -f -n '__fish_seen_subcommand_from create secret docker-registry' -l validate -d 'If true, use a schema to validate the input before sending it' + +# Completions for the "kubectl create secret generic" command +complete -c kubectl -f -n '__fish_seen_subcommand_from create secret generic' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create secret generic' -l append-hash -d 'Append a hash of the secret to its name.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create secret generic' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create secret generic' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create secret generic' -r -l from-env-file -d 'Specify the path to a file to read lines of key=val pairs to create a secret (i.e. a Docker .env file).' +complete -c kubectl -f -n '__fish_seen_subcommand_from create secret generic' -r -l from-file -d 'Key files can be specified using their file path, in which case a default name will be given to them, or optionally with a name and file path, in which case the given name will be used. Specifying a directory will iterate each named file in the directory that is a valid secret key.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create secret generic' -r -l from-literal -d 'Specify a key and literal value to insert in secret (i.e. mykey=somevalue)' +complete -c kubectl -f -n '__fish_seen_subcommand_from create secret generic' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create secret generic' -l save-config -d 'If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.' +complete -c kubectl -n '__fish_seen_subcommand_from create secret generic' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' +complete -c kubectl -f -n '__fish_seen_subcommand_from create secret generic' -r -l type -d 'The type of secret to create' +complete -c kubectl -f -n '__fish_seen_subcommand_from create secret generic' -l validate -d 'If true, use a schema to validate the input before sending it' + +# Completions for the "kubectl create secret tls" command +complete -c kubectl -f -n '__fish_seen_subcommand_from create secret tls' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create secret tls' -l append-hash -d 'Append a hash of the secret to its name.' +complete -c kubectl -n '__fish_seen_subcommand_from create secret tls' -r -l cert -d 'Path to PEM encoded public key certificate.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create secret tls' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create secret tls' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -n '__fish_seen_subcommand_from create secret tls' -r -l key -d 'Path to private key associated with given certificate.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create secret tls' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create secret tls' -l save-config -d 'If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.' +complete -c kubectl -n '__fish_seen_subcommand_from create secret tls' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' +complete -c kubectl -f -n '__fish_seen_subcommand_from create secret tls' -l validate -d 'If true, use a schema to validate the input before sending it' + +# Completions for the "kubectl create service" command +function __fish_kubectl_get_create_service_commands + echo clusterip\t'Create a ClusterIP service.' + echo externalname\t'Create an ExternalName service.' + echo loadbalancer\t'Create a LoadBalancer service.' + echo nodeport\t'Create a NodePort service.' +end + +function __fish_kubectl_get_create_service_commands_without_descriptions + __fish_kubectl_get_create_service_commands | string replace -r '\t.*$' '' +end + +complete -c kubectl -f -n "__fish_kubectl_using_command service; and not __fish_seen_subcommand_from (__fish_kubectl_get_create_service_commands_without_descriptions)" -a '(__fish_kubectl_get_create_service_commands)' +complete -c kubectl -f -n "__fish_kubectl_using_command svc; and not __fish_seen_subcommand_from (__fish_kubectl_get_create_service_commands_without_descriptions)" -a '(__fish_kubectl_get_create_service_commands)' + +# Completions for the "kubectl create service clusterip" command +complete -c kubectl -f -n '__fish_seen_subcommand_from create service clusterip' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create service clusterip' -r -l clusterip -d 'Assign your own ClusterIP or set to \'None\' for a \'headless\' service (no loadbalancing).' +complete -c kubectl -f -n '__fish_seen_subcommand_from create service clusterip' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create service clusterip' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create service clusterip' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create service clusterip' -l save-config -d 'If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create service clusterip' -r -l tcp -d 'Port pairs can be specified as \':\'.' +complete -c kubectl -n '__fish_seen_subcommand_from create service clusterip' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' +complete -c kubectl -f -n '__fish_seen_subcommand_from create service clusterip' -l validate -d 'If true, use a schema to validate the input before sending it' + +# Completions for the "kubectl create service externalname" command +complete -c kubectl -f -n '__fish_seen_subcommand_from create service externalname' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create service externalname' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create service externalname' -r -l external-name -d 'External name of service' +complete -c kubectl -f -n '__fish_seen_subcommand_from create service externalname' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create service externalname' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create service externalname' -l save-config -d 'If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create service externalname' -r -l tcp -d 'Port pairs can be specified as \':\'.' +complete -c kubectl -n '__fish_seen_subcommand_from create service externalname' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' +complete -c kubectl -f -n '__fish_seen_subcommand_from create service externalname' -l validate -d 'If true, use a schema to validate the input before sending it' + +# Completions for the "kubectl create service loadbalancer" command +complete -c kubectl -f -n '__fish_seen_subcommand_from create service loadbalancer' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create service loadbalancer' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create service loadbalancer' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create service loadbalancer' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create service loadbalancer' -l save-config -d 'If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create service loadbalancer' -r -l tcp -d 'Port pairs can be specified as \':\'.' +complete -c kubectl -n '__fish_seen_subcommand_from create service loadbalancer' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' +complete -c kubectl -f -n '__fish_seen_subcommand_from create service loadbalancer' -l validate -d 'If true, use a schema to validate the input before sending it' + +# Completions for the "kubectl create service nodeport" command +complete -c kubectl -f -n '__fish_seen_subcommand_from create service nodeport' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create service nodeport' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create service nodeport' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create service nodeport' -r -l node-port -d 'Port used to expose the service on each node in a cluster.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create service nodeport' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create service nodeport' -l save-config -d 'If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create service nodeport' -r -l tcp -d 'Port pairs can be specified as \':\'.' +complete -c kubectl -n '__fish_seen_subcommand_from create service nodeport' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' +complete -c kubectl -f -n '__fish_seen_subcommand_from create service nodeport' -l validate -d 'If true, use a schema to validate the input before sending it' + +# Completions for the "kubectl create serviceaccount" command +complete -c kubectl -f -n '__fish_seen_subcommand_from create serviceaccount' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create sa' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create serviceaccount' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create sa' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create serviceaccount' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create sa' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create serviceaccount' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create sa' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create serviceaccount' -l save-config -d 'If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.' +complete -c kubectl -f -n '__fish_seen_subcommand_from create sa' -l save-config -d 'If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.' +complete -c kubectl -n '__fish_seen_subcommand_from create serviceaccount' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' +complete -c kubectl -n '__fish_seen_subcommand_from create sa' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' +complete -c kubectl -f -n '__fish_seen_subcommand_from create serviceaccount' -l validate -d 'If true, use a schema to validate the input before sending it' +complete -c kubectl -f -n '__fish_seen_subcommand_from create sa' -l validate -d 'If true, use a schema to validate the input before sending it' + +# Completions for the "kubectl debug" command +complete -c kubectl -f -n '__fish_seen_subcommand_from debug' -l arguments-only -d 'If specified, everything after -- will be passed to the new container as Args instead of Command.' +complete -c kubectl -f -n '__fish_seen_subcommand_from debug' -l attach -d 'If true, wait for the container to start running, and then attach as if \'kubectl attach ...\' were called. Default false, unless \'-i/--stdin\' is set, in which case the default is true.' +complete -c kubectl -f -n '__fish_seen_subcommand_from debug' -r -s c -l container -d 'Container name to use for debug container.' +complete -c kubectl -f -n '__fish_seen_subcommand_from debug' -r -l copy-to -d 'Create a copy of the target Pod with this name.' +complete -c kubectl -f -n '__fish_seen_subcommand_from debug' -r -l env -d 'Environment variables to set in the container.' +complete -c kubectl -f -n '__fish_seen_subcommand_from debug' -r -l image -d 'Container image to use for debug container.' +complete -c kubectl -f -n '__fish_seen_subcommand_from debug' -r -l image-pull-policy -d 'The image pull policy for the container. If left empty, this value will not be specified by the client and defaulted by the server.' +complete -c kubectl -f -n '__fish_seen_subcommand_from debug' -l quiet -d 'If true, suppress informational messages.' +complete -c kubectl -f -n '__fish_seen_subcommand_from debug' -l replace -d 'When used with \'--copy-to\', delete the original Pod.' +complete -c kubectl -f -n '__fish_seen_subcommand_from debug' -l same-node -d 'When used with \'--copy-to\', schedule the copy of target Pod on the same node.' +complete -c kubectl -f -n '__fish_seen_subcommand_from debug' -r -l set-image -d 'When used with \'--copy-to\', a list of name=image pairs for changing container images, similar to how \'kubectl set image\' works.' +complete -c kubectl -f -n '__fish_seen_subcommand_from debug' -l share-processes -d 'When used with \'--copy-to\', enable process namespace sharing in the copy.' +complete -c kubectl -f -n '__fish_seen_subcommand_from debug' -s i -l stdin -d 'Keep stdin open on the container(s) in the pod, even if nothing is attached.' +complete -c kubectl -f -n '__fish_seen_subcommand_from debug' -r -l target -d 'When using an ephemeral container, target processes in this container name.' +complete -c kubectl -f -n '__fish_seen_subcommand_from debug' -s t -l tty -d 'Allocate a TTY for the debugging container.' + +# Completions for the "kubectl delete" command +complete -c kubectl -f -n '__fish_seen_subcommand_from delete' -l all -d 'Delete all resources, including uninitialized ones, in the namespace of the specified resource types.' +complete -c kubectl -f -n '__fish_seen_subcommand_from delete' -s A -l all-namespaces -d 'If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.' +complete -c kubectl -f -n '__fish_seen_subcommand_from delete' -r -l cascade -d 'Must be "background", "orphan", or "foreground". Selects the deletion cascading strategy for the dependents (e.g. Pods created by a ReplicationController). Defaults to background.' +complete -c kubectl -f -n '__fish_seen_subcommand_from delete' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from delete' -r -l field-selector -d 'Selector (field query) to filter on, supports \'=\', \'==\', and \'!=\'.(e.g. --field-selector key1=value1,key2=value2). The server only supports a limited number of field queries per type.' +complete -c kubectl -n '__fish_seen_subcommand_from delete' -r -s f -l filename -d 'containing the resource to delete.' +complete -c kubectl -f -n '__fish_seen_subcommand_from delete' -l force -d 'If true, immediately remove resources from API and bypass graceful deletion. Note that immediate deletion of some resources may result in inconsistency or data loss and requires confirmation.' +complete -c kubectl -f -n '__fish_seen_subcommand_from delete' -r -l grace-period -d 'Period of time in seconds given to the resource to terminate gracefully. Ignored if negative. Set to 1 for immediate shutdown. Can only be set to 0 when --force is true (force deletion).' +complete -c kubectl -f -n '__fish_seen_subcommand_from delete' -l ignore-not-found -d 'Treat "resource not found" as a successful delete. Defaults to "true" when --all is specified.' +complete -c kubectl -f -n '__fish_seen_subcommand_from delete' -r -s k -l kustomize -d 'Process a kustomization directory. This flag can\'t be used together with -f or -R.' +complete -c kubectl -f -n '__fish_seen_subcommand_from delete' -l now -d 'If true, resources are signaled for immediate shutdown (same as --grace-period=1).' +complete -c kubectl -f -n '__fish_seen_subcommand_from delete' -r -s o -l output -d 'Output mode. Use "-o name" for shorter output (resource/name).' +complete -c kubectl -f -n '__fish_seen_subcommand_from delete' -r -l raw -d 'Raw URI to DELETE to the server. Uses the transport specified by the kubeconfig file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from delete' -s R -l recursive -d 'Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.' +complete -c kubectl -f -n '__fish_seen_subcommand_from delete' -r -s l -l selector -d 'Selector (label query) to filter on, not including uninitialized ones.' +complete -c kubectl -f -n '__fish_seen_subcommand_from delete' -r -l timeout -d 'The length of time to wait before giving up on a delete, zero means determine a timeout from the size of the object' +complete -c kubectl -f -n '__fish_seen_subcommand_from delete' -l wait -d 'If true, wait for resources to be gone before returning. This waits for finalizers.' + +# Completions for the "kubectl describe" command +complete -c kubectl -f -n '__fish_seen_subcommand_from describe' -s A -l all-namespaces -d 'If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.' +complete -c kubectl -n '__fish_seen_subcommand_from describe' -r -s f -l filename -d 'Filename, directory, or URL to files containing the resource to describe' +complete -c kubectl -f -n '__fish_seen_subcommand_from describe' -r -s k -l kustomize -d 'Process the kustomization directory. This flag can\'t be used together with -f or -R.' +complete -c kubectl -f -n '__fish_seen_subcommand_from describe' -s R -l recursive -d 'Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.' +complete -c kubectl -f -n '__fish_seen_subcommand_from describe' -r -s l -l selector -d 'Selector (label query) to filter on, supports \'=\', \'==\', and \'!=\'.(e.g. -l key1=value1,key2=value2)' +complete -c kubectl -f -n '__fish_seen_subcommand_from describe' -l show-events -d 'If true, display events related to the described object.' + +# Completions for the "kubectl diff" command +complete -c kubectl -f -n '__fish_seen_subcommand_from diff' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -n '__fish_seen_subcommand_from diff' -r -s f -l filename -d 'Filename, directory, or URL to files contains the configuration to diff' +complete -c kubectl -f -n '__fish_seen_subcommand_from diff' -l force-conflicts -d 'If true, server-side apply will force the changes against conflicts.' +complete -c kubectl -f -n '__fish_seen_subcommand_from diff' -r -s k -l kustomize -d 'Process the kustomization directory. This flag can\'t be used together with -f or -R.' +complete -c kubectl -f -n '__fish_seen_subcommand_from diff' -s R -l recursive -d 'Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.' +complete -c kubectl -f -n '__fish_seen_subcommand_from diff' -r -s l -l selector -d 'Selector (label query) to filter on, supports \'=\', \'==\', and \'!=\'.(e.g. -l key1=value1,key2=value2)' +complete -c kubectl -f -n '__fish_seen_subcommand_from diff' -l server-side -d 'If true, apply runs in the server instead of the client.' + +# Completions for the "kubectl drain" command +complete -c kubectl -f -n '__fish_seen_subcommand_from drain' -l delete-emptydir-data -d 'Continue even if there are pods using emptyDir (local data that will be deleted when the node is drained).' +complete -c kubectl -f -n '__fish_seen_subcommand_from drain' -l disable-eviction -d 'Force drain to use delete, even if eviction is supported. This will bypass checking PodDisruptionBudgets, use with caution.' +complete -c kubectl -f -n '__fish_seen_subcommand_from drain' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from drain' -l force -d 'Continue even if there are pods not managed by a ReplicationController, ReplicaSet, Job, DaemonSet or StatefulSet.' +complete -c kubectl -f -n '__fish_seen_subcommand_from drain' -r -l grace-period -d 'Period of time in seconds given to each pod to terminate gracefully. If negative, the default value specified in the pod will be used.' +complete -c kubectl -f -n '__fish_seen_subcommand_from drain' -l ignore-daemonsets -d 'Ignore DaemonSet-managed pods.' +complete -c kubectl -f -n '__fish_seen_subcommand_from drain' -r -l pod-selector -d 'Label selector to filter pods on the node' +complete -c kubectl -f -n '__fish_seen_subcommand_from drain' -r -s l -l selector -d 'Selector (label query) to filter on' +complete -c kubectl -f -n '__fish_seen_subcommand_from drain' -r -l skip-wait-for-delete-timeout -d 'If pod DeletionTimestamp older than N seconds, skip waiting for the pod. Seconds must be greater than 0 to skip.' +complete -c kubectl -f -n '__fish_seen_subcommand_from drain' -r -l timeout -d 'The length of time to wait before giving up, zero means infinite' + +# Completions for the "kubectl edit" command +complete -c kubectl -f -n '__fish_seen_subcommand_from edit' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from edit' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -n '__fish_seen_subcommand_from edit' -r -s f -l filename -d 'Filename, directory, or URL to files to use to edit the resource' +complete -c kubectl -f -n '__fish_seen_subcommand_from edit' -r -s k -l kustomize -d 'Process the kustomization directory. This flag can\'t be used together with -f or -R.' +complete -c kubectl -f -n '__fish_seen_subcommand_from edit' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from edit' -l output-patch -d 'Output the patch if the resource is edited.' +complete -c kubectl -f -n '__fish_seen_subcommand_from edit' -l record -d 'Record current kubectl command in the resource annotation. If set to false, do not record the command. If set to true, record the command. If not set, default to updating the existing annotation value only if one already exists.' +complete -c kubectl -f -n '__fish_seen_subcommand_from edit' -s R -l recursive -d 'Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.' +complete -c kubectl -f -n '__fish_seen_subcommand_from edit' -l save-config -d 'If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.' +complete -c kubectl -n '__fish_seen_subcommand_from edit' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' +complete -c kubectl -f -n '__fish_seen_subcommand_from edit' -l validate -d 'If true, use a schema to validate the input before sending it' +complete -c kubectl -f -n '__fish_seen_subcommand_from edit' -l windows-line-endings -d 'Defaults to the line ending native to your platform.' + +# Completions for the "kubectl exec" command +complete -c kubectl -f -n '__fish_seen_subcommand_from exec' -r -s c -l container -d 'Container name. If omitted, the first container in the pod will be chosen' +complete -c kubectl -n '__fish_seen_subcommand_from exec' -r -s f -l filename -d 'to use to exec into the resource' +complete -c kubectl -f -n '__fish_seen_subcommand_from exec' -r -l pod-running-timeout -d 'The length of time (like 5s, 2m, or 3h, higher than zero) to wait until at least one pod is running' +complete -c kubectl -f -n '__fish_seen_subcommand_from exec' -s i -l stdin -d 'Pass stdin to the container' +complete -c kubectl -f -n '__fish_seen_subcommand_from exec' -s t -l tty -d 'Stdin is a TTY' + +# Completions for the "kubectl explain" command +complete -c kubectl -f -n '__fish_seen_subcommand_from explain' -r -l api-version -d 'Get different explanations for particular API version (API group/version)' +complete -c kubectl -f -n '__fish_seen_subcommand_from explain' -l recursive -d 'Print the fields of fields (Currently only 1 level deep)' + +# Completions for the "kubectl expose" command +complete -c kubectl -f -n '__fish_seen_subcommand_from expose' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from expose' -r -l cluster-ip -d 'ClusterIP to be assigned to the service. Leave empty to auto-allocate, or set to \'None\' to create a headless service.' +complete -c kubectl -f -n '__fish_seen_subcommand_from expose' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from expose' -r -l external-ip -d 'Additional external IP address (not managed by Kubernetes) to accept for the service. If this IP is routed to a node, the service can be accessed by this IP in addition to its generated service IP.' +complete -c kubectl -f -n '__fish_seen_subcommand_from expose' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -n '__fish_seen_subcommand_from expose' -r -s f -l filename -d 'Filename, directory, or URL to files identifying the resource to expose a service' +complete -c kubectl -f -n '__fish_seen_subcommand_from expose' -r -l generator -d 'The name of the API generator to use. There are 2 generators: \'service/v1\' and \'service/v2\'. The only difference between them is that service port in v1 is named \'default\', while it is left unnamed in v2. Default is \'service/v2\'.' +complete -c kubectl -f -n '__fish_seen_subcommand_from expose' -r -s k -l kustomize -d 'Process the kustomization directory. This flag can\'t be used together with -f or -R.' +complete -c kubectl -f -n '__fish_seen_subcommand_from expose' -r -s l -l labels -d 'Labels to apply to the service created by this call.' +complete -c kubectl -f -n '__fish_seen_subcommand_from expose' -r -l load-balancer-ip -d 'IP to assign to the LoadBalancer. If empty, an ephemeral IP will be created and used (cloud-provider specific).' +complete -c kubectl -f -n '__fish_seen_subcommand_from expose' -r -l name -d 'The name for the newly created object.' +complete -c kubectl -f -n '__fish_seen_subcommand_from expose' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from expose' -r -l overrides -d 'An inline JSON override for the generated object. If this is non-empty, it is used to override the generated object. Requires that the object supply a valid apiVersion field.' +complete -c kubectl -f -n '__fish_seen_subcommand_from expose' -r -l port -d 'The port that the service should serve on. Copied from the resource being exposed, if unspecified' +complete -c kubectl -f -n '__fish_seen_subcommand_from expose' -r -l protocol -d 'The network protocol for the service to be created. Default is \'TCP\'.' +complete -c kubectl -f -n '__fish_seen_subcommand_from expose' -l record -d 'Record current kubectl command in the resource annotation. If set to false, do not record the command. If set to true, record the command. If not set, default to updating the existing annotation value only if one already exists.' +complete -c kubectl -f -n '__fish_seen_subcommand_from expose' -s R -l recursive -d 'Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.' +complete -c kubectl -f -n '__fish_seen_subcommand_from expose' -l save-config -d 'If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.' +complete -c kubectl -f -n '__fish_seen_subcommand_from expose' -r -l selector -d 'A label selector to use for this service. Only equality-based selector requirements are supported. If empty (the default) infer the selector from the replication controller or replica set.)' +complete -c kubectl -f -n '__fish_seen_subcommand_from expose' -r -l session-affinity -d 'If non-empty, set the session affinity for the service to this; legal values: \'None\', \'ClientIP\'' +complete -c kubectl -f -n '__fish_seen_subcommand_from expose' -r -l target-port -d 'Name or number for the port on the container that the service should direct traffic to. Optional.' +complete -c kubectl -n '__fish_seen_subcommand_from expose' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' +complete -c kubectl -f -n '__fish_seen_subcommand_from expose' -r -l type -d 'Type for this service: ClusterIP, NodePort, LoadBalancer, or ExternalName. Default is \'ClusterIP\'.' + +# Completions for the "kubectl get" command +complete -c kubectl -f -n '__fish_seen_subcommand_from get' -s A -l all-namespaces -d 'If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.' +complete -c kubectl -f -n '__fish_seen_subcommand_from get' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from get' -r -l chunk-size -d 'Return large lists in chunks rather than all at once. Pass 0 to disable. This flag is beta and may change in the future.' +complete -c kubectl -f -n '__fish_seen_subcommand_from get' -r -l field-selector -d 'Selector (field query) to filter on, supports \'=\', \'==\', and \'!=\'.(e.g. --field-selector key1=value1,key2=value2). The server only supports a limited number of field queries per type.' +complete -c kubectl -n '__fish_seen_subcommand_from get' -r -s f -l filename -d 'Filename, directory, or URL to files identifying the resource to get from a server.' +complete -c kubectl -f -n '__fish_seen_subcommand_from get' -l ignore-not-found -d 'If the requested object does not exist the command will return exit code 0.' +complete -c kubectl -f -n '__fish_seen_subcommand_from get' -r -s k -l kustomize -d 'Process the kustomization directory. This flag can\'t be used together with -f or -R.' +complete -c kubectl -f -n '__fish_seen_subcommand_from get' -r -s L -l label-columns -d 'Accepts a comma separated list of labels that are going to be presented as columns. Names are case-sensitive. You can also use multiple flag options like -L label1 -L label2...' +complete -c kubectl -f -n '__fish_seen_subcommand_from get' -l no-headers -d 'When using the default or custom-column output format, don\'t print headers (default print headers).' +complete -c kubectl -f -n '__fish_seen_subcommand_from get' -r -s o -l output -d 'Output format. One of: json|yaml|wide|name|custom-columns=...|custom-columns-file=...|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=... See custom columns [http://kubernetes.io/docs/user-guide/kubectl-overview/#custom-columns], golang template [http://golang.org/pkg/text/template/#pkg-overview] and jsonpath template [http://kubernetes.io/docs/user-guide/jsonpath].' +complete -c kubectl -f -n '__fish_seen_subcommand_from get' -l output-watch-events -d 'Output watch event objects when --watch or --watch-only is used. Existing objects are output as initial ADDED events.' +complete -c kubectl -f -n '__fish_seen_subcommand_from get' -r -l raw -d 'Raw URI to request from the server. Uses the transport specified by the kubeconfig file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from get' -s R -l recursive -d 'Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.' +complete -c kubectl -f -n '__fish_seen_subcommand_from get' -r -s l -l selector -d 'Selector (label query) to filter on, supports \'=\', \'==\', and \'!=\'.(e.g. -l key1=value1,key2=value2)' +complete -c kubectl -f -n '__fish_seen_subcommand_from get' -l server-print -d 'If true, have the server return the appropriate table output. Supports extension APIs and CRDs.' +complete -c kubectl -f -n '__fish_seen_subcommand_from get' -l show-kind -d 'If present, list the resource type for the requested object(s).' +complete -c kubectl -f -n '__fish_seen_subcommand_from get' -l show-labels -d 'When printing, show all labels as the last column (default hide labels column)' +complete -c kubectl -f -n '__fish_seen_subcommand_from get' -r -l sort-by -d 'If non-empty, sort list types using this field specification. The field specification is expressed as a JSONPath expression (e.g. \'{.metadata.name}\'). The field in the API resource specified by this JSONPath expression must be an integer or a string.' +complete -c kubectl -n '__fish_seen_subcommand_from get' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' +complete -c kubectl -f -n '__fish_seen_subcommand_from get' -s w -l watch -d 'After listing/getting the requested object, watch for changes. Uninitialized objects are excluded if no object name is provided.' +complete -c kubectl -f -n '__fish_seen_subcommand_from get' -l watch-only -d 'Watch for changes to the requested object(s), without listing/getting first.' + +# Completions for the "kubectl label" command +complete -c kubectl -f -n '__fish_seen_subcommand_from label' -l all -d 'Select all resources, including uninitialized ones, in the namespace of the specified resource types' +complete -c kubectl -f -n '__fish_seen_subcommand_from label' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from label' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from label' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -f -n '__fish_seen_subcommand_from label' -r -l field-selector -d 'Selector (field query) to filter on, supports \'=\', \'==\', and \'!=\'.(e.g. --field-selector key1=value1,key2=value2). The server only supports a limited number of field queries per type.' +complete -c kubectl -n '__fish_seen_subcommand_from label' -r -s f -l filename -d 'Filename, directory, or URL to files identifying the resource to update the labels' +complete -c kubectl -f -n '__fish_seen_subcommand_from label' -r -s k -l kustomize -d 'Process the kustomization directory. This flag can\'t be used together with -f or -R.' +complete -c kubectl -f -n '__fish_seen_subcommand_from label' -l list -d 'If true, display the labels for a given resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from label' -l local -d 'If true, label will NOT contact api-server but run locally.' +complete -c kubectl -f -n '__fish_seen_subcommand_from label' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from label' -l overwrite -d 'If true, allow labels to be overwritten, otherwise reject label updates that overwrite existing labels.' +complete -c kubectl -f -n '__fish_seen_subcommand_from label' -l record -d 'Record current kubectl command in the resource annotation. If set to false, do not record the command. If set to true, record the command. If not set, default to updating the existing annotation value only if one already exists.' +complete -c kubectl -f -n '__fish_seen_subcommand_from label' -s R -l recursive -d 'Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.' +complete -c kubectl -f -n '__fish_seen_subcommand_from label' -r -l resource-version -d 'If non-empty, the labels update will only succeed if this is the current resource-version for the object. Only valid when specifying a single resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from label' -r -s l -l selector -d 'Selector (label query) to filter on, not including uninitialized ones, supports \'=\', \'==\', and \'!=\'.(e.g. -l key1=value1,key2=value2).' +complete -c kubectl -n '__fish_seen_subcommand_from label' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' + +# Completions for the "kubectl logs" command +complete -c kubectl -f -n '__fish_seen_subcommand_from logs' -l all-containers -d 'Get all containers\' logs in the pod(s).' +complete -c kubectl -f -n '__fish_seen_subcommand_from logs' -r -s c -l container -d 'Print the logs of this container' +complete -c kubectl -f -n '__fish_seen_subcommand_from logs' -s f -l follow -d 'Specify if the logs should be streamed.' +complete -c kubectl -f -n '__fish_seen_subcommand_from logs' -l ignore-errors -d 'If watching / following pod logs, allow for any errors that occur to be non-fatal' +complete -c kubectl -f -n '__fish_seen_subcommand_from logs' -l insecure-skip-tls-verify-backend -d 'Skip verifying the identity of the kubelet that logs are requested from. In theory, an attacker could provide invalid log content back. You might want to use this if your kubelet serving certificates have expired.' +complete -c kubectl -f -n '__fish_seen_subcommand_from logs' -r -l limit-bytes -d 'Maximum bytes of logs to return. Defaults to no limit.' +complete -c kubectl -f -n '__fish_seen_subcommand_from logs' -r -l max-log-requests -d 'Specify maximum number of concurrent logs to follow when using by a selector. Defaults to 5.' +complete -c kubectl -f -n '__fish_seen_subcommand_from logs' -r -l pod-running-timeout -d 'The length of time (like 5s, 2m, or 3h, higher than zero) to wait until at least one pod is running' +complete -c kubectl -f -n '__fish_seen_subcommand_from logs' -l prefix -d 'Prefix each log line with the log source (pod name and container name)' +complete -c kubectl -f -n '__fish_seen_subcommand_from logs' -s p -l previous -d 'If true, print the logs for the previous instance of the container in a pod if it exists.' +complete -c kubectl -f -n '__fish_seen_subcommand_from logs' -r -s l -l selector -d 'Selector (label query) to filter on.' +complete -c kubectl -f -n '__fish_seen_subcommand_from logs' -r -l since -d 'Only return logs newer than a relative duration like 5s, 2m, or 3h. Defaults to all logs. Only one of since-time / since may be used.' +complete -c kubectl -f -n '__fish_seen_subcommand_from logs' -r -l since-time -d 'Only return logs after a specific date (RFC3339). Defaults to all logs. Only one of since-time / since may be used.' +complete -c kubectl -f -n '__fish_seen_subcommand_from logs' -r -l tail -d 'Lines of recent log file to display. Defaults to -1 with no selector, showing all log lines otherwise 10, if a selector is provided.' +complete -c kubectl -f -n '__fish_seen_subcommand_from logs' -l timestamps -d 'Include timestamps on each line in the log output' + +# Completions for the "kubectl patch" command +complete -c kubectl -f -n '__fish_seen_subcommand_from patch' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from patch' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from patch' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -n '__fish_seen_subcommand_from patch' -r -s f -l filename -d 'Filename, directory, or URL to files identifying the resource to update' +complete -c kubectl -f -n '__fish_seen_subcommand_from patch' -r -s k -l kustomize -d 'Process the kustomization directory. This flag can\'t be used together with -f or -R.' +complete -c kubectl -f -n '__fish_seen_subcommand_from patch' -l local -d 'If true, patch will operate on the content of the file, not the server-side resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from patch' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from patch' -r -s p -l patch -d 'The patch to be applied to the resource JSON file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from patch' -r -l patch-file -d 'A file containing a patch to be applied to the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from patch' -l record -d 'Record current kubectl command in the resource annotation. If set to false, do not record the command. If set to true, record the command. If not set, default to updating the existing annotation value only if one already exists.' +complete -c kubectl -f -n '__fish_seen_subcommand_from patch' -s R -l recursive -d 'Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.' +complete -c kubectl -n '__fish_seen_subcommand_from patch' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' +complete -c kubectl -f -n '__fish_seen_subcommand_from patch' -r -l type -d 'The type of patch being provided; one of [json merge strategic]' + +# Completions for the "kubectl plugin" command +function __fish_kubectl_get_plugin_commands + echo list\t'list all visible plugin executables on a user\'s PATH' +end + +function __fish_kubectl_get_plugin_commands_without_descriptions + __fish_kubectl_get_plugin_commands | string replace -r '\t.*$' '' +end + +complete -c kubectl -f -n "__fish_kubectl_using_command plugin; and not __fish_seen_subcommand_from (__fish_kubectl_get_plugin_commands_without_descriptions)" -a '(__fish_kubectl_get_plugin_commands)' + +# Completions for the "kubectl plugin list" command +complete -c kubectl -f -n '__fish_seen_subcommand_from plugin list' -l name-only -d 'If true, display only the binary name of each plugin, rather than its full path' + +# Completions for the "kubectl port-forward" command +complete -c kubectl -f -n '__fish_seen_subcommand_from port-forward' -r -l address -d 'Addresses to listen on (comma separated). Only accepts IP addresses or localhost as a value. When localhost is supplied, kubectl will try to bind on both 127.0.0.1 and ::1 and will fail if neither of these addresses are available to bind.' +complete -c kubectl -f -n '__fish_seen_subcommand_from port-forward' -r -l pod-running-timeout -d 'The length of time (like 5s, 2m, or 3h, higher than zero) to wait until at least one pod is running' + +# Completions for the "kubectl proxy" command +complete -c kubectl -f -n '__fish_seen_subcommand_from proxy' -r -l accept-hosts -d 'Regular expression for hosts that the proxy should accept.' +complete -c kubectl -f -n '__fish_seen_subcommand_from proxy' -r -l accept-paths -d 'Regular expression for paths that the proxy should accept.' +complete -c kubectl -f -n '__fish_seen_subcommand_from proxy' -r -l address -d 'The IP address on which to serve on.' +complete -c kubectl -f -n '__fish_seen_subcommand_from proxy' -r -l api-prefix -d 'Prefix to serve the proxied API under.' +complete -c kubectl -f -n '__fish_seen_subcommand_from proxy' -l disable-filter -d 'If true, disable request filtering in the proxy. This is dangerous, and can leave you vulnerable to XSRF attacks, when used with an accessible port.' +complete -c kubectl -f -n '__fish_seen_subcommand_from proxy' -r -l keepalive -d 'keepalive specifies the keep-alive period for an active network connection. Set to 0 to disable keepalive.' +complete -c kubectl -f -n '__fish_seen_subcommand_from proxy' -r -s p -l port -d 'The port on which to run the proxy. Set to 0 to pick a random port.' +complete -c kubectl -f -n '__fish_seen_subcommand_from proxy' -r -l reject-methods -d 'Regular expression for HTTP methods that the proxy should reject (example --reject-methods=\'POST,PUT,PATCH\'). ' +complete -c kubectl -f -n '__fish_seen_subcommand_from proxy' -r -l reject-paths -d 'Regular expression for paths that the proxy should reject. Paths specified here will be rejected even accepted by --accept-paths.' +complete -c kubectl -f -n '__fish_seen_subcommand_from proxy' -r -s u -l unix-socket -d 'Unix socket on which to run the proxy.' +complete -c kubectl -f -n '__fish_seen_subcommand_from proxy' -r -s w -l www -d 'Also serve static files from the given directory under the specified prefix.' +complete -c kubectl -f -n '__fish_seen_subcommand_from proxy' -r -s P -l www-prefix -d 'Prefix to serve static files under, if static file directory is specified.' + +# Completions for the "kubectl replace" command +complete -c kubectl -f -n '__fish_seen_subcommand_from replace' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from replace' -r -l cascade -d 'Must be "background", "orphan", or "foreground". Selects the deletion cascading strategy for the dependents (e.g. Pods created by a ReplicationController). Defaults to background.' +complete -c kubectl -f -n '__fish_seen_subcommand_from replace' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from replace' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -n '__fish_seen_subcommand_from replace' -r -s f -l filename -d 'to use to replace the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from replace' -l force -d 'If true, immediately remove resources from API and bypass graceful deletion. Note that immediate deletion of some resources may result in inconsistency or data loss and requires confirmation.' +complete -c kubectl -f -n '__fish_seen_subcommand_from replace' -r -l grace-period -d 'Period of time in seconds given to the resource to terminate gracefully. Ignored if negative. Set to 1 for immediate shutdown. Can only be set to 0 when --force is true (force deletion).' +complete -c kubectl -f -n '__fish_seen_subcommand_from replace' -r -s k -l kustomize -d 'Process a kustomization directory. This flag can\'t be used together with -f or -R.' +complete -c kubectl -f -n '__fish_seen_subcommand_from replace' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from replace' -r -l raw -d 'Raw URI to PUT to the server. Uses the transport specified by the kubeconfig file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from replace' -s R -l recursive -d 'Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.' +complete -c kubectl -f -n '__fish_seen_subcommand_from replace' -l save-config -d 'If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.' +complete -c kubectl -n '__fish_seen_subcommand_from replace' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' +complete -c kubectl -f -n '__fish_seen_subcommand_from replace' -r -l timeout -d 'The length of time to wait before giving up on a delete, zero means determine a timeout from the size of the object' +complete -c kubectl -f -n '__fish_seen_subcommand_from replace' -l validate -d 'If true, use a schema to validate the input before sending it' +complete -c kubectl -f -n '__fish_seen_subcommand_from replace' -l wait -d 'If true, wait for resources to be gone before returning. This waits for finalizers.' + +# Completions for the "kubectl rollout" command +function __fish_kubectl_get_rollout_commands + echo history\t'View rollout history' + echo pause\t'Mark the provided resource as paused' + echo restart\t'Restart a resource' + echo resume\t'Resume a paused resource' + echo status\t'Show the status of the rollout' + echo undo\t'Undo a previous rollout' +end + +function __fish_kubectl_get_rollout_commands_without_descriptions + __fish_kubectl_get_rollout_commands | string replace -r '\t.*$' '' +end + +complete -c kubectl -f -n "__fish_kubectl_using_command rollout; and not __fish_seen_subcommand_from (__fish_kubectl_get_rollout_commands_without_descriptions)" -a '(__fish_kubectl_get_rollout_commands)' + +# Completions for the "kubectl rollout history" command +complete -c kubectl -f -n '__fish_seen_subcommand_from rollout history' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -n '__fish_seen_subcommand_from rollout history' -r -s f -l filename -d 'Filename, directory, or URL to files identifying the resource to get from a server.' +complete -c kubectl -f -n '__fish_seen_subcommand_from rollout history' -r -s k -l kustomize -d 'Process the kustomization directory. This flag can\'t be used together with -f or -R.' +complete -c kubectl -f -n '__fish_seen_subcommand_from rollout history' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from rollout history' -s R -l recursive -d 'Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.' +complete -c kubectl -f -n '__fish_seen_subcommand_from rollout history' -r -l revision -d 'See the details, including podTemplate of the revision specified' +complete -c kubectl -n '__fish_seen_subcommand_from rollout history' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' + +# Completions for the "kubectl rollout pause" command +complete -c kubectl -f -n '__fish_seen_subcommand_from rollout pause' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from rollout pause' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -n '__fish_seen_subcommand_from rollout pause' -r -s f -l filename -d 'Filename, directory, or URL to files identifying the resource to get from a server.' +complete -c kubectl -f -n '__fish_seen_subcommand_from rollout pause' -r -s k -l kustomize -d 'Process the kustomization directory. This flag can\'t be used together with -f or -R.' +complete -c kubectl -f -n '__fish_seen_subcommand_from rollout pause' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from rollout pause' -s R -l recursive -d 'Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.' +complete -c kubectl -n '__fish_seen_subcommand_from rollout pause' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' + +# Completions for the "kubectl rollout restart" command +complete -c kubectl -f -n '__fish_seen_subcommand_from rollout restart' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from rollout restart' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -n '__fish_seen_subcommand_from rollout restart' -r -s f -l filename -d 'Filename, directory, or URL to files identifying the resource to get from a server.' +complete -c kubectl -f -n '__fish_seen_subcommand_from rollout restart' -r -s k -l kustomize -d 'Process the kustomization directory. This flag can\'t be used together with -f or -R.' +complete -c kubectl -f -n '__fish_seen_subcommand_from rollout restart' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from rollout restart' -s R -l recursive -d 'Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.' +complete -c kubectl -n '__fish_seen_subcommand_from rollout restart' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' + +# Completions for the "kubectl rollout resume" command +complete -c kubectl -f -n '__fish_seen_subcommand_from rollout resume' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from rollout resume' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -n '__fish_seen_subcommand_from rollout resume' -r -s f -l filename -d 'Filename, directory, or URL to files identifying the resource to get from a server.' +complete -c kubectl -f -n '__fish_seen_subcommand_from rollout resume' -r -s k -l kustomize -d 'Process the kustomization directory. This flag can\'t be used together with -f or -R.' +complete -c kubectl -f -n '__fish_seen_subcommand_from rollout resume' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from rollout resume' -s R -l recursive -d 'Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.' +complete -c kubectl -n '__fish_seen_subcommand_from rollout resume' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' + +# Completions for the "kubectl rollout status" command +complete -c kubectl -n '__fish_seen_subcommand_from rollout status' -r -s f -l filename -d 'Filename, directory, or URL to files identifying the resource to get from a server.' +complete -c kubectl -f -n '__fish_seen_subcommand_from rollout status' -r -s k -l kustomize -d 'Process the kustomization directory. This flag can\'t be used together with -f or -R.' +complete -c kubectl -f -n '__fish_seen_subcommand_from rollout status' -s R -l recursive -d 'Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.' +complete -c kubectl -f -n '__fish_seen_subcommand_from rollout status' -r -l revision -d 'Pin to a specific revision for showing its status. Defaults to 0 (last revision).' +complete -c kubectl -f -n '__fish_seen_subcommand_from rollout status' -r -l timeout -d 'The length of time to wait before ending watch, zero means never. Any other values should contain a corresponding time unit (e.g. 1s, 2m, 3h).' +complete -c kubectl -f -n '__fish_seen_subcommand_from rollout status' -s w -l watch -d 'Watch the status of the rollout until it\'s done.' + +# Completions for the "kubectl rollout undo" command +complete -c kubectl -f -n '__fish_seen_subcommand_from rollout undo' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from rollout undo' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -n '__fish_seen_subcommand_from rollout undo' -r -s f -l filename -d 'Filename, directory, or URL to files identifying the resource to get from a server.' +complete -c kubectl -f -n '__fish_seen_subcommand_from rollout undo' -r -s k -l kustomize -d 'Process the kustomization directory. This flag can\'t be used together with -f or -R.' +complete -c kubectl -f -n '__fish_seen_subcommand_from rollout undo' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from rollout undo' -s R -l recursive -d 'Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.' +complete -c kubectl -n '__fish_seen_subcommand_from rollout undo' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' +complete -c kubectl -f -n '__fish_seen_subcommand_from rollout undo' -r -l to-revision -d 'The revision to rollback to. Default to 0 (last revision).' + +# Completions for the "kubectl run" command +complete -c kubectl -f -n '__fish_seen_subcommand_from run' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from run' -r -l annotations -d 'Annotations to apply to the pod.' +complete -c kubectl -f -n '__fish_seen_subcommand_from run' -l attach -d 'If true, wait for the Pod to start running, and then attach to the Pod as if \'kubectl attach ...\' were called. Default false, unless \'-i/--stdin\' is set, in which case the default is true. With \'--restart=Never\' the exit code of the container process is returned.' +complete -c kubectl -f -n '__fish_seen_subcommand_from run' -r -l cascade -d 'Must be "background", "orphan", or "foreground". Selects the deletion cascading strategy for the dependents (e.g. Pods created by a ReplicationController). Defaults to background.' +complete -c kubectl -f -n '__fish_seen_subcommand_from run' -l command -d 'If true and extra arguments are present, use them as the \'command\' field in the container, rather than the \'args\' field which is the default.' +complete -c kubectl -f -n '__fish_seen_subcommand_from run' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from run' -r -l env -d 'Environment variables to set in the container.' +complete -c kubectl -f -n '__fish_seen_subcommand_from run' -l expose -d 'If true, service is created for the container(s) which are run' +complete -c kubectl -f -n '__fish_seen_subcommand_from run' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -n '__fish_seen_subcommand_from run' -r -s f -l filename -d 'to use to replace the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from run' -l force -d 'If true, immediately remove resources from API and bypass graceful deletion. Note that immediate deletion of some resources may result in inconsistency or data loss and requires confirmation.' +complete -c kubectl -f -n '__fish_seen_subcommand_from run' -r -l grace-period -d 'Period of time in seconds given to the resource to terminate gracefully. Ignored if negative. Set to 1 for immediate shutdown. Can only be set to 0 when --force is true (force deletion).' +complete -c kubectl -f -n '__fish_seen_subcommand_from run' -r -l hostport -d 'The host port mapping for the container port. To demonstrate a single-machine container.' +complete -c kubectl -f -n '__fish_seen_subcommand_from run' -r -l image -d 'The image for the container to run.' +complete -c kubectl -f -n '__fish_seen_subcommand_from run' -r -l image-pull-policy -d 'The image pull policy for the container. If left empty, this value will not be specified by the client and defaulted by the server' +complete -c kubectl -f -n '__fish_seen_subcommand_from run' -r -s k -l kustomize -d 'Process a kustomization directory. This flag can\'t be used together with -f or -R.' +complete -c kubectl -f -n '__fish_seen_subcommand_from run' -r -s l -l labels -d 'Comma separated labels to apply to the pod(s). Will override previous values.' +complete -c kubectl -f -n '__fish_seen_subcommand_from run' -l leave-stdin-open -d 'If the pod is started in interactive mode or with stdin, leave stdin open after the first attach completes. By default, stdin will be closed after the first attach completes.' +complete -c kubectl -f -n '__fish_seen_subcommand_from run' -r -l limits -d 'The resource requirement limits for this container. For example, \'cpu=200m,memory=512Mi\'. Note that server side components may assign limits depending on the server configuration, such as limit ranges.' +complete -c kubectl -f -n '__fish_seen_subcommand_from run' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from run' -r -l overrides -d 'An inline JSON override for the generated object. If this is non-empty, it is used to override the generated object. Requires that the object supply a valid apiVersion field.' +complete -c kubectl -f -n '__fish_seen_subcommand_from run' -r -l pod-running-timeout -d 'The length of time (like 5s, 2m, or 3h, higher than zero) to wait until at least one pod is running' +complete -c kubectl -f -n '__fish_seen_subcommand_from run' -r -l port -d 'The port that this container exposes.' +complete -c kubectl -f -n '__fish_seen_subcommand_from run' -l privileged -d 'If true, run the container in privileged mode.' +complete -c kubectl -f -n '__fish_seen_subcommand_from run' -l quiet -d 'If true, suppress prompt messages.' +complete -c kubectl -f -n '__fish_seen_subcommand_from run' -l record -d 'Record current kubectl command in the resource annotation. If set to false, do not record the command. If set to true, record the command. If not set, default to updating the existing annotation value only if one already exists.' +complete -c kubectl -f -n '__fish_seen_subcommand_from run' -s R -l recursive -d 'Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.' +complete -c kubectl -f -n '__fish_seen_subcommand_from run' -r -l requests -d 'The resource requirement requests for this container. For example, \'cpu=100m,memory=256Mi\'. Note that server side components may assign requests depending on the server configuration, such as limit ranges.' +complete -c kubectl -f -n '__fish_seen_subcommand_from run' -r -l restart -d 'The restart policy for this Pod. Legal values [Always, OnFailure, Never].' +complete -c kubectl -f -n '__fish_seen_subcommand_from run' -l rm -d 'If true, delete resources created in this command for attached containers.' +complete -c kubectl -f -n '__fish_seen_subcommand_from run' -l save-config -d 'If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.' +complete -c kubectl -f -n '__fish_seen_subcommand_from run' -r -l serviceaccount -d 'Service account to set in the pod spec.' +complete -c kubectl -f -n '__fish_seen_subcommand_from run' -s i -l stdin -d 'Keep stdin open on the container(s) in the pod, even if nothing is attached.' +complete -c kubectl -n '__fish_seen_subcommand_from run' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' +complete -c kubectl -f -n '__fish_seen_subcommand_from run' -r -l timeout -d 'The length of time to wait before giving up on a delete, zero means determine a timeout from the size of the object' +complete -c kubectl -f -n '__fish_seen_subcommand_from run' -s t -l tty -d 'Allocated a TTY for each container in the pod.' +complete -c kubectl -f -n '__fish_seen_subcommand_from run' -l wait -d 'If true, wait for resources to be gone before returning. This waits for finalizers.' + +# Completions for the "kubectl scale" command +complete -c kubectl -f -n '__fish_seen_subcommand_from scale' -l all -d 'Select all resources in the namespace of the specified resource types' +complete -c kubectl -f -n '__fish_seen_subcommand_from scale' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from scale' -r -l current-replicas -d 'Precondition for current size. Requires that the current size of the resource match this value in order to scale.' +complete -c kubectl -f -n '__fish_seen_subcommand_from scale' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -n '__fish_seen_subcommand_from scale' -r -s f -l filename -d 'Filename, directory, or URL to files identifying the resource to set a new size' +complete -c kubectl -f -n '__fish_seen_subcommand_from scale' -r -s k -l kustomize -d 'Process the kustomization directory. This flag can\'t be used together with -f or -R.' +complete -c kubectl -f -n '__fish_seen_subcommand_from scale' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from scale' -l record -d 'Record current kubectl command in the resource annotation. If set to false, do not record the command. If set to true, record the command. If not set, default to updating the existing annotation value only if one already exists.' +complete -c kubectl -f -n '__fish_seen_subcommand_from scale' -s R -l recursive -d 'Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.' +complete -c kubectl -f -n '__fish_seen_subcommand_from scale' -r -l replicas -d 'The new desired number of replicas. Required.' +complete -c kubectl -f -n '__fish_seen_subcommand_from scale' -r -l resource-version -d 'Precondition for resource version. Requires that the current resource version match this value in order to scale.' +complete -c kubectl -f -n '__fish_seen_subcommand_from scale' -r -s l -l selector -d 'Selector (label query) to filter on, supports \'=\', \'==\', and \'!=\'.(e.g. -l key1=value1,key2=value2)' +complete -c kubectl -n '__fish_seen_subcommand_from scale' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' +complete -c kubectl -f -n '__fish_seen_subcommand_from scale' -r -l timeout -d 'The length of time to wait before giving up on a scale operation, zero means don\'t wait. Any other values should contain a corresponding time unit (e.g. 1s, 2m, 3h).' + +# Completions for the "kubectl set" command +function __fish_kubectl_get_set_commands + echo env\t'Update environment variables on a pod template' + echo image\t'Update image of a pod template' + echo resources\t'Update resource requests/limits on objects with pod templates' + echo selector\t'Set the selector on a resource' + echo serviceaccount\t'Update ServiceAccount of a resource' + echo sa\t'Update ServiceAccount of a resource' + echo subject\t'Update User, Group or ServiceAccount in a RoleBinding/ClusterRoleBinding' +end + +function __fish_kubectl_get_set_commands_without_descriptions + __fish_kubectl_get_set_commands | string replace -r '\t.*$' '' +end + +complete -c kubectl -f -n "__fish_kubectl_using_command set; and not __fish_seen_subcommand_from (__fish_kubectl_get_set_commands_without_descriptions)" -a '(__fish_kubectl_get_set_commands)' + +# Completions for the "kubectl set env" command +complete -c kubectl -f -n '__fish_seen_subcommand_from set env' -l all -d 'If true, select all resources in the namespace of the specified resource types' +complete -c kubectl -f -n '__fish_seen_subcommand_from set env' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set env' -r -s c -l containers -d 'The names of containers in the selected pod templates to change - may use wildcards' +complete -c kubectl -f -n '__fish_seen_subcommand_from set env' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set env' -r -s e -l env -d 'Specify a key-value pair for an environment variable to set into each container.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set env' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -n '__fish_seen_subcommand_from set env' -r -s f -l filename -d 'Filename, directory, or URL to files the resource to update the env' +complete -c kubectl -f -n '__fish_seen_subcommand_from set env' -r -l from -d 'The name of a resource from which to inject environment variables' +complete -c kubectl -f -n '__fish_seen_subcommand_from set env' -r -l keys -d 'Comma-separated list of keys to import from specified resource' +complete -c kubectl -f -n '__fish_seen_subcommand_from set env' -r -s k -l kustomize -d 'Process the kustomization directory. This flag can\'t be used together with -f or -R.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set env' -l list -d 'If true, display the environment and any changes in the standard format. this flag will removed when we have kubectl view env.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set env' -l local -d 'If true, set env will NOT contact api-server but run locally.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set env' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set env' -l overwrite -d 'If true, allow environment to be overwritten, otherwise reject updates that overwrite existing environment.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set env' -r -l prefix -d 'Prefix to append to variable names' +complete -c kubectl -f -n '__fish_seen_subcommand_from set env' -s R -l recursive -d 'Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set env' -l resolve -d 'If true, show secret or configmap references when listing variables' +complete -c kubectl -f -n '__fish_seen_subcommand_from set env' -r -s l -l selector -d 'Selector (label query) to filter on' +complete -c kubectl -n '__fish_seen_subcommand_from set env' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' + +# Completions for the "kubectl set image" command +complete -c kubectl -f -n '__fish_seen_subcommand_from set image' -l all -d 'Select all resources, including uninitialized ones, in the namespace of the specified resource types' +complete -c kubectl -f -n '__fish_seen_subcommand_from set image' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set image' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set image' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -n '__fish_seen_subcommand_from set image' -r -s f -l filename -d 'Filename, directory, or URL to files identifying the resource to get from a server.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set image' -r -s k -l kustomize -d 'Process the kustomization directory. This flag can\'t be used together with -f or -R.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set image' -l local -d 'If true, set image will NOT contact api-server but run locally.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set image' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set image' -l record -d 'Record current kubectl command in the resource annotation. If set to false, do not record the command. If set to true, record the command. If not set, default to updating the existing annotation value only if one already exists.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set image' -s R -l recursive -d 'Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set image' -r -s l -l selector -d 'Selector (label query) to filter on, not including uninitialized ones, supports \'=\', \'==\', and \'!=\'.(e.g. -l key1=value1,key2=value2)' +complete -c kubectl -n '__fish_seen_subcommand_from set image' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' + +# Completions for the "kubectl set resources" command +complete -c kubectl -f -n '__fish_seen_subcommand_from set resources' -l all -d 'Select all resources, including uninitialized ones, in the namespace of the specified resource types' +complete -c kubectl -f -n '__fish_seen_subcommand_from set resources' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set resources' -r -s c -l containers -d 'The names of containers in the selected pod templates to change, all containers are selected by default - may use wildcards' +complete -c kubectl -f -n '__fish_seen_subcommand_from set resources' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set resources' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -n '__fish_seen_subcommand_from set resources' -r -s f -l filename -d 'Filename, directory, or URL to files identifying the resource to get from a server.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set resources' -r -s k -l kustomize -d 'Process the kustomization directory. This flag can\'t be used together with -f or -R.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set resources' -r -l limits -d 'The resource requirement requests for this container. For example, \'cpu=100m,memory=256Mi\'. Note that server side components may assign requests depending on the server configuration, such as limit ranges.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set resources' -l local -d 'If true, set resources will NOT contact api-server but run locally.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set resources' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set resources' -l record -d 'Record current kubectl command in the resource annotation. If set to false, do not record the command. If set to true, record the command. If not set, default to updating the existing annotation value only if one already exists.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set resources' -s R -l recursive -d 'Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set resources' -r -l requests -d 'The resource requirement requests for this container. For example, \'cpu=100m,memory=256Mi\'. Note that server side components may assign requests depending on the server configuration, such as limit ranges.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set resources' -r -s l -l selector -d 'Selector (label query) to filter on, not including uninitialized ones,supports \'=\', \'==\', and \'!=\'.(e.g. -l key1=value1,key2=value2)' +complete -c kubectl -n '__fish_seen_subcommand_from set resources' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' + +# Completions for the "kubectl set selector" command +complete -c kubectl -f -n '__fish_seen_subcommand_from set selector' -l all -d 'Select all resources in the namespace of the specified resource types' +complete -c kubectl -f -n '__fish_seen_subcommand_from set selector' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set selector' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set selector' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -n '__fish_seen_subcommand_from set selector' -r -s f -l filename -d 'identifying the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set selector' -l local -d 'If true, annotation will NOT contact api-server but run locally.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set selector' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set selector' -l record -d 'Record current kubectl command in the resource annotation. If set to false, do not record the command. If set to true, record the command. If not set, default to updating the existing annotation value only if one already exists.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set selector' -s R -l recursive -d 'Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set selector' -r -l resource-version -d 'If non-empty, the selectors update will only succeed if this is the current resource-version for the object. Only valid when specifying a single resource.' +complete -c kubectl -n '__fish_seen_subcommand_from set selector' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' + +# Completions for the "kubectl set serviceaccount" command +complete -c kubectl -f -n '__fish_seen_subcommand_from set serviceaccount' -l all -d 'Select all resources, including uninitialized ones, in the namespace of the specified resource types' +complete -c kubectl -f -n '__fish_seen_subcommand_from set sa' -l all -d 'Select all resources, including uninitialized ones, in the namespace of the specified resource types' +complete -c kubectl -f -n '__fish_seen_subcommand_from set serviceaccount' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set sa' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set serviceaccount' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set sa' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set serviceaccount' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set sa' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -n '__fish_seen_subcommand_from set serviceaccount' -r -s f -l filename -d 'Filename, directory, or URL to files identifying the resource to get from a server.' +complete -c kubectl -n '__fish_seen_subcommand_from set sa' -r -s f -l filename -d 'Filename, directory, or URL to files identifying the resource to get from a server.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set serviceaccount' -r -s k -l kustomize -d 'Process the kustomization directory. This flag can\'t be used together with -f or -R.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set sa' -r -s k -l kustomize -d 'Process the kustomization directory. This flag can\'t be used together with -f or -R.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set serviceaccount' -l local -d 'If true, set serviceaccount will NOT contact api-server but run locally.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set sa' -l local -d 'If true, set serviceaccount will NOT contact api-server but run locally.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set serviceaccount' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set sa' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set serviceaccount' -l record -d 'Record current kubectl command in the resource annotation. If set to false, do not record the command. If set to true, record the command. If not set, default to updating the existing annotation value only if one already exists.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set sa' -l record -d 'Record current kubectl command in the resource annotation. If set to false, do not record the command. If set to true, record the command. If not set, default to updating the existing annotation value only if one already exists.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set serviceaccount' -s R -l recursive -d 'Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set sa' -s R -l recursive -d 'Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.' +complete -c kubectl -n '__fish_seen_subcommand_from set serviceaccount' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' +complete -c kubectl -n '__fish_seen_subcommand_from set sa' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' + +# Completions for the "kubectl set subject" command +complete -c kubectl -f -n '__fish_seen_subcommand_from set subject' -l all -d 'Select all resources, including uninitialized ones, in the namespace of the specified resource types' +complete -c kubectl -f -n '__fish_seen_subcommand_from set subject' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set subject' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set subject' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -n '__fish_seen_subcommand_from set subject' -r -s f -l filename -d 'Filename, directory, or URL to files the resource to update the subjects' +complete -c kubectl -f -n '__fish_seen_subcommand_from set subject' -r -l group -d 'Groups to bind to the role' +complete -c kubectl -f -n '__fish_seen_subcommand_from set subject' -r -s k -l kustomize -d 'Process the kustomization directory. This flag can\'t be used together with -f or -R.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set subject' -l local -d 'If true, set subject will NOT contact api-server but run locally.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set subject' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set subject' -s R -l recursive -d 'Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.' +complete -c kubectl -f -n '__fish_seen_subcommand_from set subject' -r -s l -l selector -d 'Selector (label query) to filter on, not including uninitialized ones, supports \'=\', \'==\', and \'!=\'.(e.g. -l key1=value1,key2=value2)' +complete -c kubectl -f -n '__fish_seen_subcommand_from set subject' -r -l serviceaccount -d 'Service accounts to bind to the role' +complete -c kubectl -n '__fish_seen_subcommand_from set subject' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' + +# Completions for the "kubectl taint" command +complete -c kubectl -f -n '__fish_seen_subcommand_from taint' -l all -d 'Select all nodes in the cluster' +complete -c kubectl -f -n '__fish_seen_subcommand_from taint' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from taint' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from taint' -r -l field-manager -d 'Name of the manager used to track field ownership.' +complete -c kubectl -f -n '__fish_seen_subcommand_from taint' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from taint' -l overwrite -d 'If true, allow taints to be overwritten, otherwise reject taint updates that overwrite existing taints.' +complete -c kubectl -f -n '__fish_seen_subcommand_from taint' -r -s l -l selector -d 'Selector (label query) to filter on, supports \'=\', \'==\', and \'!=\'.(e.g. -l key1=value1,key2=value2)' +complete -c kubectl -n '__fish_seen_subcommand_from taint' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' +complete -c kubectl -f -n '__fish_seen_subcommand_from taint' -l validate -d 'If true, use a schema to validate the input before sending it' + +# Completions for the "kubectl top" command +function __fish_kubectl_get_top_commands + echo node\t'Display Resource (CPU/Memory/Storage) usage of nodes' + echo nodes\t'Display Resource (CPU/Memory/Storage) usage of nodes' + echo no\t'Display Resource (CPU/Memory/Storage) usage of nodes' + echo pod\t'Display Resource (CPU/Memory/Storage) usage of pods' + echo pods\t'Display Resource (CPU/Memory/Storage) usage of pods' + echo po\t'Display Resource (CPU/Memory/Storage) usage of pods' +end + +function __fish_kubectl_get_top_commands_without_descriptions + __fish_kubectl_get_top_commands | string replace -r '\t.*$' '' +end + +complete -c kubectl -f -n "__fish_kubectl_using_command top; and not __fish_seen_subcommand_from (__fish_kubectl_get_top_commands_without_descriptions)" -a '(__fish_kubectl_get_top_commands)' + +# Completions for the "kubectl top node" command +complete -c kubectl -f -n '__fish_seen_subcommand_from top node' -l no-headers -d 'If present, print output without headers' +complete -c kubectl -f -n '__fish_seen_subcommand_from top nodes' -l no-headers -d 'If present, print output without headers' +complete -c kubectl -f -n '__fish_seen_subcommand_from top no' -l no-headers -d 'If present, print output without headers' +complete -c kubectl -f -n '__fish_seen_subcommand_from top node' -r -s l -l selector -d 'Selector (label query) to filter on, supports \'=\', \'==\', and \'!=\'.(e.g. -l key1=value1,key2=value2)' +complete -c kubectl -f -n '__fish_seen_subcommand_from top nodes' -r -s l -l selector -d 'Selector (label query) to filter on, supports \'=\', \'==\', and \'!=\'.(e.g. -l key1=value1,key2=value2)' +complete -c kubectl -f -n '__fish_seen_subcommand_from top no' -r -s l -l selector -d 'Selector (label query) to filter on, supports \'=\', \'==\', and \'!=\'.(e.g. -l key1=value1,key2=value2)' +complete -c kubectl -f -n '__fish_seen_subcommand_from top node' -r -l sort-by -d 'If non-empty, sort nodes list using specified field. The field can be either \'cpu\' or \'memory\'.' +complete -c kubectl -f -n '__fish_seen_subcommand_from top nodes' -r -l sort-by -d 'If non-empty, sort nodes list using specified field. The field can be either \'cpu\' or \'memory\'.' +complete -c kubectl -f -n '__fish_seen_subcommand_from top no' -r -l sort-by -d 'If non-empty, sort nodes list using specified field. The field can be either \'cpu\' or \'memory\'.' + +# Completions for the "kubectl top pod" command +complete -c kubectl -f -n '__fish_seen_subcommand_from top pod' -s A -l all-namespaces -d 'If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.' +complete -c kubectl -f -n '__fish_seen_subcommand_from top pods' -s A -l all-namespaces -d 'If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.' +complete -c kubectl -f -n '__fish_seen_subcommand_from top po' -s A -l all-namespaces -d 'If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.' +complete -c kubectl -f -n '__fish_seen_subcommand_from top pod' -l containers -d 'If present, print usage of containers within a pod.' +complete -c kubectl -f -n '__fish_seen_subcommand_from top pods' -l containers -d 'If present, print usage of containers within a pod.' +complete -c kubectl -f -n '__fish_seen_subcommand_from top po' -l containers -d 'If present, print usage of containers within a pod.' +complete -c kubectl -f -n '__fish_seen_subcommand_from top pod' -l no-headers -d 'If present, print output without headers.' +complete -c kubectl -f -n '__fish_seen_subcommand_from top pods' -l no-headers -d 'If present, print output without headers.' +complete -c kubectl -f -n '__fish_seen_subcommand_from top po' -l no-headers -d 'If present, print output without headers.' +complete -c kubectl -f -n '__fish_seen_subcommand_from top pod' -r -s l -l selector -d 'Selector (label query) to filter on, supports \'=\', \'==\', and \'!=\'.(e.g. -l key1=value1,key2=value2)' +complete -c kubectl -f -n '__fish_seen_subcommand_from top pods' -r -s l -l selector -d 'Selector (label query) to filter on, supports \'=\', \'==\', and \'!=\'.(e.g. -l key1=value1,key2=value2)' +complete -c kubectl -f -n '__fish_seen_subcommand_from top po' -r -s l -l selector -d 'Selector (label query) to filter on, supports \'=\', \'==\', and \'!=\'.(e.g. -l key1=value1,key2=value2)' +complete -c kubectl -f -n '__fish_seen_subcommand_from top pod' -r -l sort-by -d 'If non-empty, sort pods list using specified field. The field can be either \'cpu\' or \'memory\'.' +complete -c kubectl -f -n '__fish_seen_subcommand_from top pods' -r -l sort-by -d 'If non-empty, sort pods list using specified field. The field can be either \'cpu\' or \'memory\'.' +complete -c kubectl -f -n '__fish_seen_subcommand_from top po' -r -l sort-by -d 'If non-empty, sort pods list using specified field. The field can be either \'cpu\' or \'memory\'.' + +# Completions for the "kubectl uncordon" command +complete -c kubectl -f -n '__fish_seen_subcommand_from uncordon' -r -l dry-run -d 'Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from uncordon' -r -s l -l selector -d 'Selector (label query) to filter on' + +# Completions for the "kubectl version" command +complete -c kubectl -f -n '__fish_seen_subcommand_from version' -l client -d 'If true, shows client version only (no server required).' +complete -c kubectl -f -n '__fish_seen_subcommand_from version' -r -s o -l output -d 'One of \'yaml\' or \'json\'.' +complete -c kubectl -f -n '__fish_seen_subcommand_from version' -l short -d 'If true, print just the version number.' + +# Completions for the "kubectl wait" command +complete -c kubectl -f -n '__fish_seen_subcommand_from wait' -l all -d 'Select all resources in the namespace of the specified resource types' +complete -c kubectl -f -n '__fish_seen_subcommand_from wait' -s A -l all-namespaces -d 'If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.' +complete -c kubectl -f -n '__fish_seen_subcommand_from wait' -l allow-missing-template-keys -d 'If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.' +complete -c kubectl -f -n '__fish_seen_subcommand_from wait' -r -l field-selector -d 'Selector (field query) to filter on, supports \'=\', \'==\', and \'!=\'.(e.g. --field-selector key1=value1,key2=value2). The server only supports a limited number of field queries per type.' +complete -c kubectl -n '__fish_seen_subcommand_from wait' -r -s f -l filename -d 'identifying the resource.' +complete -c kubectl -f -n '__fish_seen_subcommand_from wait' -r -l for -d 'The condition to wait on: [delete|condition=condition-name].' +complete -c kubectl -f -n '__fish_seen_subcommand_from wait' -l local -d 'If true, annotation will NOT contact api-server but run locally.' +complete -c kubectl -f -n '__fish_seen_subcommand_from wait' -r -s o -l output -d 'Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.' +complete -c kubectl -f -n '__fish_seen_subcommand_from wait' -s R -l recursive -d 'Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.' +complete -c kubectl -f -n '__fish_seen_subcommand_from wait' -r -s l -l selector -d 'Selector (label query) to filter on, supports \'=\', \'==\', and \'!=\'.(e.g. -l key1=value1,key2=value2)' +complete -c kubectl -n '__fish_seen_subcommand_from wait' -r -l template -d 'Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].' +complete -c kubectl -f -n '__fish_seen_subcommand_from wait' -r -l timeout -d 'The length of time to wait before giving up. Zero means check once and don\'t wait, negative means wait for a week.' diff --git a/fish/completions/poetry.fish b/fish/completions/poetry.fish new file mode 100644 index 0000000..575e91f --- /dev/null +++ b/fish/completions/poetry.fish @@ -0,0 +1,142 @@ +function __fish_poetry_34b8720aa1470c44_complete_no_subcommand + for i in (commandline -opc) + if contains -- $i about add build cache check config debug env export help init install lock new publish remove run search self shell show update version + return 1 + end + end + return 0 +end + +# global options +complete -c poetry -n '__fish_poetry_34b8720aa1470c44_complete_no_subcommand' -l ansi -d 'Force ANSI output' +complete -c poetry -n '__fish_poetry_34b8720aa1470c44_complete_no_subcommand' -l help -d 'Display this help message' +complete -c poetry -n '__fish_poetry_34b8720aa1470c44_complete_no_subcommand' -l no-ansi -d 'Disable ANSI output' +complete -c poetry -n '__fish_poetry_34b8720aa1470c44_complete_no_subcommand' -l no-interaction -d 'Do not ask any interactive question' +complete -c poetry -n '__fish_poetry_34b8720aa1470c44_complete_no_subcommand' -l quiet -d 'Do not output any message' +complete -c poetry -n '__fish_poetry_34b8720aa1470c44_complete_no_subcommand' -l verbose -d 'Increase the verbosity of messages: "-v" for normal output, "-vv" for more verbose output and "-vvv" for debug' +complete -c poetry -n '__fish_poetry_34b8720aa1470c44_complete_no_subcommand' -l version -d 'Display this application version' + +# commands +complete -c poetry -f -n '__fish_poetry_34b8720aa1470c44_complete_no_subcommand' -a about -d 'Shows information about Poetry.' +complete -c poetry -f -n '__fish_poetry_34b8720aa1470c44_complete_no_subcommand' -a add -d 'Adds a new dependency to pyproject.toml.' +complete -c poetry -f -n '__fish_poetry_34b8720aa1470c44_complete_no_subcommand' -a build -d 'Builds a package, as a tarball and a wheel by default.' +complete -c poetry -f -n '__fish_poetry_34b8720aa1470c44_complete_no_subcommand' -a cache -d 'Interact with Poetry\'s cache' +complete -c poetry -f -n '__fish_poetry_34b8720aa1470c44_complete_no_subcommand' -a check -d 'Checks the validity of the pyproject.toml file.' +complete -c poetry -f -n '__fish_poetry_34b8720aa1470c44_complete_no_subcommand' -a config -d 'Manages configuration settings.' +complete -c poetry -f -n '__fish_poetry_34b8720aa1470c44_complete_no_subcommand' -a debug -d 'Debug various elements of Poetry.' +complete -c poetry -f -n '__fish_poetry_34b8720aa1470c44_complete_no_subcommand' -a env -d 'Interact with Poetry\'s project environments.' +complete -c poetry -f -n '__fish_poetry_34b8720aa1470c44_complete_no_subcommand' -a export -d 'Exports the lock file to alternative formats.' +complete -c poetry -f -n '__fish_poetry_34b8720aa1470c44_complete_no_subcommand' -a help -d 'Display the manual of a command' +complete -c poetry -f -n '__fish_poetry_34b8720aa1470c44_complete_no_subcommand' -a init -d 'Creates a basic pyproject.toml file in the current directory.' +complete -c poetry -f -n '__fish_poetry_34b8720aa1470c44_complete_no_subcommand' -a install -d 'Installs the project dependencies.' +complete -c poetry -f -n '__fish_poetry_34b8720aa1470c44_complete_no_subcommand' -a lock -d 'Locks the project dependencies.' +complete -c poetry -f -n '__fish_poetry_34b8720aa1470c44_complete_no_subcommand' -a new -d 'Creates a new Python project at .' +complete -c poetry -f -n '__fish_poetry_34b8720aa1470c44_complete_no_subcommand' -a publish -d 'Publishes a package to a remote repository.' +complete -c poetry -f -n '__fish_poetry_34b8720aa1470c44_complete_no_subcommand' -a remove -d 'Removes a package from the project dependencies.' +complete -c poetry -f -n '__fish_poetry_34b8720aa1470c44_complete_no_subcommand' -a run -d 'Runs a command in the appropriate environment.' +complete -c poetry -f -n '__fish_poetry_34b8720aa1470c44_complete_no_subcommand' -a search -d 'Searches for packages on remote repositories.' +complete -c poetry -f -n '__fish_poetry_34b8720aa1470c44_complete_no_subcommand' -a self -d 'Interact with Poetry directly.' +complete -c poetry -f -n '__fish_poetry_34b8720aa1470c44_complete_no_subcommand' -a shell -d 'Spawns a shell within the virtual environment.' +complete -c poetry -f -n '__fish_poetry_34b8720aa1470c44_complete_no_subcommand' -a show -d 'Shows information about packages.' +complete -c poetry -f -n '__fish_poetry_34b8720aa1470c44_complete_no_subcommand' -a update -d 'Update the dependencies as according to the pyproject.toml file.' +complete -c poetry -f -n '__fish_poetry_34b8720aa1470c44_complete_no_subcommand' -a version -d 'Shows the version of the project or bumps it when a valid bump rule is provided.' + +# command options + +# about + +# add +complete -c poetry -A -n '__fish_seen_subcommand_from add' -l allow-prereleases -d 'Accept prereleases.' +complete -c poetry -A -n '__fish_seen_subcommand_from add' -l dev -d 'Add as a development dependency.' +complete -c poetry -A -n '__fish_seen_subcommand_from add' -l dry-run -d 'Output the operations but do not execute anything (implicitly enables --verbose).' +complete -c poetry -A -n '__fish_seen_subcommand_from add' -l extras -d 'Extras to activate for the dependency.' +complete -c poetry -A -n '__fish_seen_subcommand_from add' -l lock -d 'Do not perform operations (only update the lockfile).' +complete -c poetry -A -n '__fish_seen_subcommand_from add' -l optional -d 'Add as an optional dependency.' +complete -c poetry -A -n '__fish_seen_subcommand_from add' -l platform -d 'Platforms for which the dependency must be installed.' +complete -c poetry -A -n '__fish_seen_subcommand_from add' -l python -d 'Python version for which the dependency must be installed.' +complete -c poetry -A -n '__fish_seen_subcommand_from add' -l source -d 'Name of the source to use to install the package.' + +# build +complete -c poetry -A -n '__fish_seen_subcommand_from build' -l format -d 'Limit the format to either sdist or wheel.' + +# cache + +# check + +# config +complete -c poetry -A -n '__fish_seen_subcommand_from config' -l list -d 'List configuration settings.' +complete -c poetry -A -n '__fish_seen_subcommand_from config' -l local -d 'Set/Get from the project\'s local configuration.' +complete -c poetry -A -n '__fish_seen_subcommand_from config' -l unset -d 'Unset configuration setting.' + +# debug + +# env + +# export +complete -c poetry -A -n '__fish_seen_subcommand_from export' -l dev -d 'Include development dependencies.' +complete -c poetry -A -n '__fish_seen_subcommand_from export' -l extras -d 'Extra sets of dependencies to include.' +complete -c poetry -A -n '__fish_seen_subcommand_from export' -l format -d 'Format to export to. Currently, only requirements.txt is supported.' +complete -c poetry -A -n '__fish_seen_subcommand_from export' -l output -d 'The name of the output file.' +complete -c poetry -A -n '__fish_seen_subcommand_from export' -l with-credentials -d 'Include credentials for extra indices.' +complete -c poetry -A -n '__fish_seen_subcommand_from export' -l without-hashes -d 'Exclude hashes from the exported file.' + +# help + +# init +complete -c poetry -A -n '__fish_seen_subcommand_from init' -l author -d 'Author name of the package.' +complete -c poetry -A -n '__fish_seen_subcommand_from init' -l dependency -d 'Package to require, with an optional version constraint, e.g. requests:^2.10.0 or requests=2.11.1.' +complete -c poetry -A -n '__fish_seen_subcommand_from init' -l description -d 'Description of the package.' +complete -c poetry -A -n '__fish_seen_subcommand_from init' -l dev-dependency -d 'Package to require for development, with an optional version constraint, e.g. requests:^2.10.0 or requests=2.11.1.' +complete -c poetry -A -n '__fish_seen_subcommand_from init' -l license -d 'License of the package.' +complete -c poetry -A -n '__fish_seen_subcommand_from init' -l name -d 'Name of the package.' +complete -c poetry -A -n '__fish_seen_subcommand_from init' -l python -d 'Compatible Python versions.' + +# install +complete -c poetry -A -n '__fish_seen_subcommand_from install' -l dry-run -d 'Output the operations but do not execute anything (implicitly enables --verbose).' +complete -c poetry -A -n '__fish_seen_subcommand_from install' -l extras -d 'Extra sets of dependencies to install.' +complete -c poetry -A -n '__fish_seen_subcommand_from install' -l no-dev -d 'Do not install the development dependencies.' +complete -c poetry -A -n '__fish_seen_subcommand_from install' -l no-root -d 'Do not install the root package (the current project).' +complete -c poetry -A -n '__fish_seen_subcommand_from install' -l remove-untracked -d 'Removes packages not present in the lock file.' + +# lock +complete -c poetry -A -n '__fish_seen_subcommand_from lock' -l no-update -d 'Do not update locked versions, only refresh lock file.' + +# new +complete -c poetry -A -n '__fish_seen_subcommand_from new' -l name -d 'Set the resulting package name.' +complete -c poetry -A -n '__fish_seen_subcommand_from new' -l src -d 'Use the src layout for the project.' + +# publish +complete -c poetry -A -n '__fish_seen_subcommand_from publish' -l build -d 'Build the package before publishing.' +complete -c poetry -A -n '__fish_seen_subcommand_from publish' -l cert -d 'Certificate authority to access the repository.' +complete -c poetry -A -n '__fish_seen_subcommand_from publish' -l client-cert -d 'Client certificate to access the repository.' +complete -c poetry -A -n '__fish_seen_subcommand_from publish' -l dry-run -d 'Perform all actions except upload the package.' +complete -c poetry -A -n '__fish_seen_subcommand_from publish' -l password -d 'The password to access the repository.' +complete -c poetry -A -n '__fish_seen_subcommand_from publish' -l repository -d 'The repository to publish the package to.' +complete -c poetry -A -n '__fish_seen_subcommand_from publish' -l username -d 'The username to access the repository.' + +# remove +complete -c poetry -A -n '__fish_seen_subcommand_from remove' -l dev -d 'Remove a package from the development dependencies.' +complete -c poetry -A -n '__fish_seen_subcommand_from remove' -l dry-run -d 'Output the operations but do not execute anything (implicitly enables --verbose).' + +# run + +# search + +# self + +# shell + +# show +complete -c poetry -A -n '__fish_seen_subcommand_from show' -l all -d 'Show all packages (even those not compatible with current system).' +complete -c poetry -A -n '__fish_seen_subcommand_from show' -l latest -d 'Show the latest version.' +complete -c poetry -A -n '__fish_seen_subcommand_from show' -l no-dev -d 'Do not list the development dependencies.' +complete -c poetry -A -n '__fish_seen_subcommand_from show' -l outdated -d 'Show the latest version but only for packages that are outdated.' +complete -c poetry -A -n '__fish_seen_subcommand_from show' -l tree -d 'List the dependencies as a tree.' + +# update +complete -c poetry -A -n '__fish_seen_subcommand_from update' -l dry-run -d 'Output the operations but do not execute anything (implicitly enables --verbose).' +complete -c poetry -A -n '__fish_seen_subcommand_from update' -l lock -d 'Do not perform operations (only update the lockfile).' +complete -c poetry -A -n '__fish_seen_subcommand_from update' -l no-dev -d 'Do not update the development dependencies.' + +# version +complete -c poetry -A -n '__fish_seen_subcommand_from version' -l short -d 'Output the version number only' diff --git a/fish/completions/yq.fish b/fish/completions/yq.fish new file mode 100644 index 0000000..dffa972 --- /dev/null +++ b/fish/completions/yq.fish @@ -0,0 +1,164 @@ +# fish completion for yq -*- shell-script -*- + +function __yq_debug + set file "$BASH_COMP_DEBUG_FILE" + if test -n "$file" + echo "$argv" >> $file + end +end + +function __yq_perform_completion + __yq_debug "Starting __yq_perform_completion with: $argv" + + set args (string split -- " " "$argv") + set lastArg "$args[-1]" + + __yq_debug "args: $args" + __yq_debug "last arg: $lastArg" + + set emptyArg "" + if test -z "$lastArg" + __yq_debug "Setting emptyArg" + set emptyArg \"\" + end + __yq_debug "emptyArg: $emptyArg" + + if not type -q "$args[1]" + # This can happen when "complete --do-complete yq" is called when running this script. + __yq_debug "Cannot find $args[1]. No completions." + return + end + + set requestComp "$args[1] __complete $args[2..-1] $emptyArg" + __yq_debug "Calling $requestComp" + + set results (eval $requestComp 2> /dev/null) + set comps $results[1..-2] + set directiveLine $results[-1] + + # For Fish, when completing a flag with an = (e.g., -n=) + # completions must be prefixed with the flag + set flagPrefix (string match -r -- '-.*=' "$lastArg") + + __yq_debug "Comps: $comps" + __yq_debug "DirectiveLine: $directiveLine" + __yq_debug "flagPrefix: $flagPrefix" + + for comp in $comps + printf "%s%s\n" "$flagPrefix" "$comp" + end + + printf "%s\n" "$directiveLine" +end + +# This function does three things: +# 1- Obtain the completions and store them in the global __yq_comp_results +# 2- Set the __yq_comp_do_file_comp flag if file completion should be performed +# and unset it otherwise +# 3- Return true if the completion results are not empty +function __yq_prepare_completions + # Start fresh + set --erase __yq_comp_do_file_comp + set --erase __yq_comp_results + + # Check if the command-line is already provided. This is useful for testing. + if not set --query __yq_comp_commandLine + # Use the -c flag to allow for completion in the middle of the line + set __yq_comp_commandLine (commandline -c) + end + __yq_debug "commandLine is: $__yq_comp_commandLine" + + set results (__yq_perform_completion "$__yq_comp_commandLine") + set --erase __yq_comp_commandLine + __yq_debug "Completion results: $results" + + if test -z "$results" + __yq_debug "No completion, probably due to a failure" + # Might as well do file completion, in case it helps + set --global __yq_comp_do_file_comp 1 + return 1 + end + + set directive (string sub --start 2 $results[-1]) + set --global __yq_comp_results $results[1..-2] + + __yq_debug "Completions are: $__yq_comp_results" + __yq_debug "Directive is: $directive" + + set shellCompDirectiveError 1 + set shellCompDirectiveNoSpace 2 + set shellCompDirectiveNoFileComp 4 + set shellCompDirectiveFilterFileExt 8 + set shellCompDirectiveFilterDirs 16 + + if test -z "$directive" + set directive 0 + end + + set compErr (math (math --scale 0 $directive / $shellCompDirectiveError) % 2) + if test $compErr -eq 1 + __yq_debug "Received error directive: aborting." + # Might as well do file completion, in case it helps + set --global __yq_comp_do_file_comp 1 + return 1 + end + + set filefilter (math (math --scale 0 $directive / $shellCompDirectiveFilterFileExt) % 2) + set dirfilter (math (math --scale 0 $directive / $shellCompDirectiveFilterDirs) % 2) + if test $filefilter -eq 1; or test $dirfilter -eq 1 + __yq_debug "File extension filtering or directory filtering not supported" + # Do full file completion instead + set --global __yq_comp_do_file_comp 1 + return 1 + end + + set nospace (math (math --scale 0 $directive / $shellCompDirectiveNoSpace) % 2) + set nofiles (math (math --scale 0 $directive / $shellCompDirectiveNoFileComp) % 2) + + __yq_debug "nospace: $nospace, nofiles: $nofiles" + + # Important not to quote the variable for count to work + set numComps (count $__yq_comp_results) + __yq_debug "numComps: $numComps" + + if test $numComps -eq 1; and test $nospace -ne 0 + # To support the "nospace" directive we trick the shell + # by outputting an extra, longer completion. + __yq_debug "Adding second completion to perform nospace directive" + set --append __yq_comp_results $__yq_comp_results[1]. + end + + if test $numComps -eq 0; and test $nofiles -eq 0 + __yq_debug "Requesting file completion" + set --global __yq_comp_do_file_comp 1 + end + + # If we don't want file completion, we must return true even if there + # are no completions found. This is because fish will perform the last + # completion command, even if its condition is false, if no other + # completion command was triggered + return (not set --query __yq_comp_do_file_comp) +end + +# Since Fish completions are only loaded once the user triggers them, we trigger them ourselves +# so we can properly delete any completions provided by another script. +# The space after the the program name is essential to trigger completion for the program +# and not completion of the program name itself. +complete --do-complete "yq " > /dev/null 2>&1 +# Using '> /dev/null 2>&1' since '&>' is not supported in older versions of fish. + +# Remove any pre-existing completions for the program since we will be handling all of them. +complete -c yq -e + +# The order in which the below two lines are defined is very important so that __yq_prepare_completions +# is called first. It is __yq_prepare_completions that sets up the __yq_comp_do_file_comp variable. +# +# This completion will be run second as complete commands are added FILO. +# It triggers file completion choices when __yq_comp_do_file_comp is set. +complete -c yq -n 'set --query __yq_comp_do_file_comp' + +# This completion will be run first as complete commands are added FILO. +# The call to __yq_prepare_completions will setup both __yq_comp_results and __yq_comp_do_file_comp. +# It provides the program's completion choices. +complete -c yq -n '__yq_prepare_completions' -f -a '$__yq_comp_results' + diff --git a/fish/conf.d/fzf.fish b/fish/conf.d/fzf.fish new file mode 100644 index 0000000..c0b3b08 --- /dev/null +++ b/fish/conf.d/fzf.fish @@ -0,0 +1,35 @@ +# fzf.fish is only meant to be used in interactive mode. If not in interactive mode and not in CI, skip the config to speed up shell startup +if not status is-interactive && test "$CI" != true + exit +end + +# Because of scoping rules, to capture the shell variables exactly as they are, we must read +# them before even executing _fzf_search_variables. We use psub to store the +# variables' info in temporary files and pass in the filenames as arguments. +# # This variable is global so that it can be referenced by fzf_configure_bindings and in tests +set --global _fzf_search_vars_command '_fzf_search_variables (set --show | psub) (set --names | psub)' + + +# Install the default bindings, which are mnemonic and minimally conflict with fish's preset bindings +fzf_configure_bindings + +# Doesn't erase autoloaded _fzf_* functions because they are not easily accessible once key bindings are erased +function _fzf_uninstall --on-event fzf_uninstall + _fzf_uninstall_bindings + + set --erase _fzf_search_vars_command + functions --erase _fzf_uninstall _fzf_migration_message _fzf_uninstall_bindings fzf_configure_bindings + complete --erase fzf_configure_bindings + + set_color cyan + echo "fzf.fish uninstalled." + echo "You may need to manually remove fzf_configure_bindings from your config.fish if you were using custom key bindings." + set_color normal +end + +function _fzf_migration_message --on-event fzf_update + set_color FF8C00 # dark orange + printf '\n%s\n' 'If you last updated fzf.fish before 2021-06-11, you need to migrate your key bindings.' + printf '%s\n\n' 'Check out https://github.com/PatrickF1/fzf.fish/wiki/Migration-Guides#v7.' + set_color normal +end diff --git a/fish/conf.d/git.fish b/fish/conf.d/git.fish new file mode 100644 index 0000000..b484540 --- /dev/null +++ b/fish/conf.d/git.fish @@ -0,0 +1,11 @@ +function _git_install --on-event git_install + __git.init +end + +function _git_update --on-event git_update + __git.reset +end + +function _git_uninstall --on-event git_uninstall + __git.destroy +end diff --git a/fish/conf.d/omf.fish b/fish/conf.d/omf.fish new file mode 100644 index 0000000..3e0f6d6 --- /dev/null +++ b/fish/conf.d/omf.fish @@ -0,0 +1,7 @@ +# Path to Oh My Fish install. +set -q XDG_DATA_HOME + and set -gx OMF_PATH "$XDG_DATA_HOME/omf" + or set -gx OMF_PATH "$HOME/.local/share/omf" + +# Load Oh My Fish configuration. +source $OMF_PATH/init.fish diff --git a/fish/config.fish b/fish/config.fish new file mode 100644 index 0000000..09a5fe3 --- /dev/null +++ b/fish/config.fish @@ -0,0 +1,46 @@ +if status is-interactive + # Commands to run in interactive sessions can go here +end + +source ~/.iterm2_shell_integration.fish + +# Keyboard repeat +defaults write -g InitialKeyRepeat -int 15 # normal minimum is 15 (225 ms) +defaults write -g KeyRepeat -int 2 # normal minimum is 2 (30 ms) + + +# Aliases +alias l="ls -lah" + +alias vim="nvim" +alias vimdiff="nvim -d" + +alias gs="git status --short" +alias gll="git log --graph --oneline --all" + +alias k="kubectl" + +alias tf="terraform" +alias tfi="terraform init" +alias tfp="terraform plan" +alias tfa="terraform apply" + +alias li="linode-cli" + + +# Environment variables +set -x PATH /Users/bogdan/development/tools/tools/bin $PATH + +# Pyenv +status is-login; and pyenv init --path | source +status is-interactive; and pyenv init - | source + +# DigitalOcean +source (doctl completion fish|psub) + + +# Access Keys +set -x KUBE_CONFIG_PATH ~/.kube/config + +# The next line updates PATH for the Google Cloud SDK. +if [ -f '/Users/bogdanbuduroiu/google-cloud-sdk/path.fish.inc' ]; . '/Users/bogdanbuduroiu/google-cloud-sdk/path.fish.inc'; end diff --git a/fish/fish_plugins b/fish/fish_plugins new file mode 100644 index 0000000..72d998e --- /dev/null +++ b/fish/fish_plugins @@ -0,0 +1,5 @@ +jorgebucaran/fisher +PatrickF1/fzf.fish +evanlucas/fish-kubectl-completions +edc/bass +jhillyerd/plugin-git diff --git a/fish/fish_variables b/fish/fish_variables new file mode 100644 index 0000000..7f4c798 --- /dev/null +++ b/fish/fish_variables @@ -0,0 +1,180 @@ +# This file contains fish universal variable definitions. +# VERSION: 3.0 +SETUVAR --export SSH_AGENT_PID:8572 +SETUVAR --export SSH_AUTH_SOCK:/var/folders/nx/133kj5n14j1gj1r_t4753b440000gn/T//ssh\x2dv4cYb5FZ1xyo/agent\x2e8571 +SETUVAR __fish_initialized:3100 +SETUVAR __git_plugin_abbreviations:g\x1ega\x1egaa\x1egapa\x1egap\x1egb\x1egba\x1egban\x1egbd\x1egbD\x1egbl\x1egbs\x1egbsb\x1egbsg\x1egbsr\x1egbss\x1egc\x1egc\x21\x1egcn\x21\x1egca\x1egca\x21\x1egcan\x21\x1egcv\x1egcav\x1egcav\x21\x1egcm\x1egcam\x1egscam\x1egcfx\x1egcf\x1egcl\x1egclean\x1egclean\x21\x1egclean\x21\x21\x1egcount\x1egcp\x1egcpa\x1egcpc\x1egd\x1egdca\x1egds\x1egdsc\x1egdw\x1egdwc\x1egdto\x1egignore\x1egf\x1egfa\x1egfm\x1egfo\x1egl\x1egll\x1eglr\x1eglg\x1eglgg\x1eglgga\x1eglo\x1eglog\x1eglom\x1eglod\x1egloo\x1egm\x1egmt\x1egp\x1egp\x21\x1egpo\x1egpo\x21\x1egpv\x1egpv\x21\x1eggp\x21\x1egpu\x1egr\x1egra\x1egrb\x1egrba\x1egrbc\x1egrbi\x1egrbm\x1egrbmi\x1egrbmia\x1egrbd\x1egrbdi\x1egrbdia\x1egrbs\x1egrev\x1egrh\x1egrhh\x1egrhpa\x1egrm\x1egrmc\x1egrmv\x1egrrm\x1egrs\x1egrset\x1egrss\x1egrup\x1egrv\x1egsh\x1egsd\x1egsr\x1egss\x1egst\x1egsta\x1egstd\x1egstp\x1egsts\x1egsu\x1egsur\x1egsuri\x1egts\x1egtv\x1egsw\x1egswc\x1egunignore\x1egup\x1egupv\x1egupa\x1egupav\x1egwch\x1egco\x1egcb\x1egcod\x1egcom\x1egfb\x1egff\x1egfr\x1egfh\x1egfs\x1egfbs\x1egffs\x1egfrs\x1egfhs\x1egfss\x1egfbt\x1egfft\x1egfrt\x1egfht\x1egfst\x1egfp +SETUVAR __git_plugin_initialized:Wed\x20Oct\x2013\x2011\x3a41\x3a47\x20\x2b08\x202021 +SETUVAR _fish_abbr_g:git +SETUVAR _fish_abbr_ga:git\x20add +SETUVAR _fish_abbr_gaa:git\x20add\x20\x2d\x2dall +SETUVAR _fish_abbr_gap:git\x20apply +SETUVAR _fish_abbr_gapa:git\x20add\x20\x2d\x2dpatch +SETUVAR _fish_abbr_gb:git\x20branch\x20\x2dvv +SETUVAR _fish_abbr_gbD:git\x20branch\x20\x2dD +SETUVAR _fish_abbr_gba:git\x20branch\x20\x2da\x20\x2dv +SETUVAR _fish_abbr_gban:git\x20branch\x20\x2da\x20\x2dv\x20\x2d\x2dno\x2dmerged +SETUVAR _fish_abbr_gbd:git\x20branch\x20\x2dd +SETUVAR _fish_abbr_gbl:git\x20blame\x20\x2db\x20\x2dw +SETUVAR _fish_abbr_gbs:git\x20bisect +SETUVAR _fish_abbr_gbsb:git\x20bisect\x20bad +SETUVAR _fish_abbr_gbsg:git\x20bisect\x20good +SETUVAR _fish_abbr_gbsr:git\x20bisect\x20reset +SETUVAR _fish_abbr_gbss:git\x20bisect\x20start +SETUVAR _fish_abbr_gc:git\x20commit\x20\x2dv +SETUVAR _fish_abbr_gc_21_:git\x20commit\x20\x2dv\x20\x2d\x2damend +SETUVAR _fish_abbr_gca:git\x20commit\x20\x2dv\x20\x2da +SETUVAR _fish_abbr_gca_21_:git\x20commit\x20\x2dv\x20\x2da\x20\x2d\x2damend +SETUVAR _fish_abbr_gcam:git\x20commit\x20\x2da\x20\x2dm +SETUVAR _fish_abbr_gcan_21_:git\x20commit\x20\x2dv\x20\x2da\x20\x2d\x2dno\x2dedit\x20\x2d\x2damend +SETUVAR _fish_abbr_gcav:git\x20commit\x20\x2da\x20\x2dv\x20\x2d\x2dno\x2dverify +SETUVAR _fish_abbr_gcav_21_:git\x20commit\x20\x2da\x20\x2dv\x20\x2d\x2dno\x2dverify\x20\x2d\x2damend +SETUVAR _fish_abbr_gcb:git\x20checkout\x20\x2db +SETUVAR _fish_abbr_gcf:git\x20config\x20\x2d\x2dlist +SETUVAR _fish_abbr_gcfx:git\x20commit\x20\x2d\x2dfixup +SETUVAR _fish_abbr_gcl:git\x20clone +SETUVAR _fish_abbr_gclean:git\x20clean\x20\x2ddi +SETUVAR _fish_abbr_gclean_21_:git\x20clean\x20\x2ddfx +SETUVAR _fish_abbr_gclean_21_21_:git\x20reset\x20\x2d\x2dhard\x3b\x20and\x20git\x20clean\x20\x2ddfx +SETUVAR _fish_abbr_gcm:git\x20commit\x20\x2dm +SETUVAR _fish_abbr_gcn_21_:git\x20commit\x20\x2dv\x20\x2d\x2dno\x2dedit\x20\x2d\x2damend +SETUVAR _fish_abbr_gco:git\x20checkout +SETUVAR _fish_abbr_gcod:git\x20checkout\x20develop +SETUVAR _fish_abbr_gcom:git\x20checkout\x20\x28__git\x2edefault_branch\x29 +SETUVAR _fish_abbr_gcount:git\x20shortlog\x20\x2dsn +SETUVAR _fish_abbr_gcp:git\x20cherry\x2dpick +SETUVAR _fish_abbr_gcpa:git\x20cherry\x2dpick\x20\x2d\x2dabort +SETUVAR _fish_abbr_gcpc:git\x20cherry\x2dpick\x20\x2d\x2dcontinue +SETUVAR _fish_abbr_gcv:git\x20commit\x20\x2dv\x20\x2d\x2dno\x2dverify +SETUVAR _fish_abbr_gd:git\x20diff +SETUVAR _fish_abbr_gdca:git\x20diff\x20\x2d\x2dcached +SETUVAR _fish_abbr_gds:git\x20diff\x20\x2d\x2dstat +SETUVAR _fish_abbr_gdsc:git\x20diff\x20\x2d\x2dstat\x20\x2d\x2dcached +SETUVAR _fish_abbr_gdto:git\x20difftool +SETUVAR _fish_abbr_gdw:git\x20diff\x20\x2d\x2dword\x2ddiff +SETUVAR _fish_abbr_gdwc:git\x20diff\x20\x2d\x2dword\x2ddiff\x20\x2d\x2dcached +SETUVAR _fish_abbr_gf:git\x20fetch +SETUVAR _fish_abbr_gfa:git\x20fetch\x20\x2d\x2dall\x20\x2d\x2dprune +SETUVAR _fish_abbr_gfb:git\x20flow\x20bugfix +SETUVAR _fish_abbr_gfbs:git\x20flow\x20bugfix\x20start +SETUVAR _fish_abbr_gfbt:git\x20flow\x20bugfix\x20track +SETUVAR _fish_abbr_gff:git\x20flow\x20feature +SETUVAR _fish_abbr_gffs:git\x20flow\x20feature\x20start +SETUVAR _fish_abbr_gfft:git\x20flow\x20feature\x20track +SETUVAR _fish_abbr_gfh:git\x20flow\x20hotfix +SETUVAR _fish_abbr_gfhs:git\x20flow\x20hotfix\x20start +SETUVAR _fish_abbr_gfht:git\x20flow\x20hotfix\x20track +SETUVAR _fish_abbr_gfm:git\x20fetch\x20origin\x20\x28__git\x2edefault_branch\x29\x20\x2d\x2dprune\x3b\x20and\x20git\x20merge\x20FETCH_HEAD +SETUVAR _fish_abbr_gfo:git\x20fetch\x20origin +SETUVAR _fish_abbr_gfp:git\x20flow\x20publish +SETUVAR _fish_abbr_gfr:git\x20flow\x20release +SETUVAR _fish_abbr_gfrs:git\x20flow\x20release\x20start +SETUVAR _fish_abbr_gfrt:git\x20flow\x20release\x20track +SETUVAR _fish_abbr_gfs:git\x20flow\x20support +SETUVAR _fish_abbr_gfss:git\x20flow\x20support\x20start +SETUVAR _fish_abbr_gfst:git\x20flow\x20support\x20track +SETUVAR _fish_abbr_ggp_21_:ggp\x20\x2d\x2dforce\x2dwith\x2dlease +SETUVAR _fish_abbr_gignore:git\x20update\x2dindex\x20\x2d\x2dassume\x2dunchanged +SETUVAR _fish_abbr_gl:git\x20pull +SETUVAR _fish_abbr_glg:git\x20log\x20\x2d\x2dstat\x20\x2d\x2dmax\x2dcount\x3d10 +SETUVAR _fish_abbr_glgg:git\x20log\x20\x2d\x2dgraph\x20\x2d\x2dmax\x2dcount\x3d10 +SETUVAR _fish_abbr_glgga:git\x20log\x20\x2d\x2dgraph\x20\x2d\x2ddecorate\x20\x2d\x2dall +SETUVAR _fish_abbr_gll:git\x20pull\x20origin +SETUVAR _fish_abbr_glo:git\x20log\x20\x2d\x2doneline\x20\x2d\x2ddecorate\x20\x2d\x2dcolor +SETUVAR _fish_abbr_glod:git\x20log\x20\x2d\x2doneline\x20\x2d\x2ddecorate\x20\x2d\x2dcolor\x20develop\x2e\x2e +SETUVAR _fish_abbr_glog:git\x20log\x20\x2d\x2doneline\x20\x2d\x2ddecorate\x20\x2d\x2dcolor\x20\x2d\x2dgraph +SETUVAR _fish_abbr_glom:git\x20log\x20\x2d\x2doneline\x20\x2d\x2ddecorate\x20\x2d\x2dcolor\x20\x28__git\x2edefault_branch\x29\x2e\x2e +SETUVAR _fish_abbr_gloo:git\x20log\x20\x2d\x2dpretty\x3dformat\x3a\x27\x25C\x28yellow\x29\x25h\x20\x25Cred\x25ad\x20\x25Cblue\x25an\x25Cgreen\x25d\x20\x25Creset\x25s\x27\x20\x2d\x2ddate\x3dshort +SETUVAR _fish_abbr_glr:git\x20pull\x20\x2d\x2drebase +SETUVAR _fish_abbr_gm:git\x20merge +SETUVAR _fish_abbr_gmt:git\x20mergetool\x20\x2d\x2dno\x2dprompt +SETUVAR _fish_abbr_gp:git\x20push +SETUVAR _fish_abbr_gp_21_:git\x20push\x20\x2d\x2dforce\x2dwith\x2dlease +SETUVAR _fish_abbr_gpo:git\x20push\x20origin +SETUVAR _fish_abbr_gpo_21_:git\x20push\x20\x2d\x2dforce\x2dwith\x2dlease\x20origin +SETUVAR _fish_abbr_gpu:ggp\x20\x2d\x2dset\x2dupstream +SETUVAR _fish_abbr_gpv:git\x20push\x20\x2d\x2dno\x2dverify +SETUVAR _fish_abbr_gpv_21_:git\x20push\x20\x2d\x2dno\x2dverify\x20\x2d\x2dforce\x2dwith\x2dlease +SETUVAR _fish_abbr_gr:git\x20remote\x20\x2dvv +SETUVAR _fish_abbr_gra:git\x20remote\x20add +SETUVAR _fish_abbr_grb:git\x20rebase +SETUVAR _fish_abbr_grba:git\x20rebase\x20\x2d\x2dabort +SETUVAR _fish_abbr_grbc:git\x20rebase\x20\x2d\x2dcontinue +SETUVAR _fish_abbr_grbd:git\x20rebase\x20develop +SETUVAR _fish_abbr_grbdi:git\x20rebase\x20develop\x20\x2d\x2dinteractive +SETUVAR _fish_abbr_grbdia:git\x20rebase\x20develop\x20\x2d\x2dinteractive\x20\x2d\x2dautosquash +SETUVAR _fish_abbr_grbi:git\x20rebase\x20\x2d\x2dinteractive +SETUVAR _fish_abbr_grbm:git\x20rebase\x20\x28__git\x2edefault_branch\x29 +SETUVAR _fish_abbr_grbmi:git\x20rebase\x20\x28__git\x2edefault_branch\x29\x20\x2d\x2dinteractive +SETUVAR _fish_abbr_grbmia:git\x20rebase\x20\x28__git\x2edefault_branch\x29\x20\x2d\x2dinteractive\x20\x2d\x2dautosquash +SETUVAR _fish_abbr_grbs:git\x20rebase\x20\x2d\x2dskip +SETUVAR _fish_abbr_grev:git\x20revert +SETUVAR _fish_abbr_grh:git\x20reset +SETUVAR _fish_abbr_grhh:git\x20reset\x20\x2d\x2dhard +SETUVAR _fish_abbr_grhpa:git\x20reset\x20\x2d\x2dpatch +SETUVAR _fish_abbr_grm:git\x20rm +SETUVAR _fish_abbr_grmc:git\x20rm\x20\x2d\x2dcached +SETUVAR _fish_abbr_grmv:git\x20remote\x20rename +SETUVAR _fish_abbr_grrm:git\x20remote\x20remove +SETUVAR _fish_abbr_grs:git\x20restore +SETUVAR _fish_abbr_grset:git\x20remote\x20set\x2durl +SETUVAR _fish_abbr_grss:git\x20restore\x20\x2d\x2dsource +SETUVAR _fish_abbr_grup:git\x20remote\x20update +SETUVAR _fish_abbr_grv:git\x20remote\x20\x2dv +SETUVAR _fish_abbr_gscam:git\x20commit\x20\x2dS\x20\x2da\x20\x2dm +SETUVAR _fish_abbr_gsd:git\x20svn\x20dcommit +SETUVAR _fish_abbr_gsh:git\x20show +SETUVAR _fish_abbr_gsr:git\x20svn\x20rebase +SETUVAR _fish_abbr_gss:git\x20status\x20\x2ds +SETUVAR _fish_abbr_gst:git\x20status +SETUVAR _fish_abbr_gsta:git\x20stash +SETUVAR _fish_abbr_gstd:git\x20stash\x20drop +SETUVAR _fish_abbr_gstp:git\x20stash\x20pop +SETUVAR _fish_abbr_gsts:git\x20stash\x20show\x20\x2d\x2dtext +SETUVAR _fish_abbr_gsu:git\x20submodule\x20update +SETUVAR _fish_abbr_gsur:git\x20submodule\x20update\x20\x2d\x2drecursive +SETUVAR _fish_abbr_gsuri:git\x20submodule\x20update\x20\x2d\x2drecursive\x20\x2d\x2dinit +SETUVAR _fish_abbr_gsw:git\x20switch +SETUVAR _fish_abbr_gswc:git\x20switch\x20\x2d\x2dcreate +SETUVAR _fish_abbr_gts:git\x20tag\x20\x2ds +SETUVAR _fish_abbr_gtv:git\x20tag +SETUVAR _fish_abbr_gunignore:git\x20update\x2dindex\x20\x2d\x2dno\x2dassume\x2dunchanged +SETUVAR _fish_abbr_gup:git\x20pull\x20\x2d\x2drebase +SETUVAR _fish_abbr_gupa:git\x20pull\x20\x2d\x2drebase\x20\x2d\x2dautostash +SETUVAR _fish_abbr_gupav:git\x20pull\x20\x2d\x2drebase\x20\x2d\x2dautostash\x20\x2dv +SETUVAR _fish_abbr_gupv:git\x20pull\x20\x2d\x2drebase\x20\x2dv +SETUVAR _fish_abbr_gwch:git\x20whatchanged\x20\x2dp\x20\x2d\x2dabbrev\x2dcommit\x20\x2d\x2dpretty\x3dmedium +SETUVAR _fisher_PatrickF1_2F_fzf_2E_fish_files:/Users/bogdan/\x2econfig/fish/functions/_fzf_configure_bindings_help\x2efish\x1e/Users/bogdan/\x2econfig/fish/functions/_fzf_extract_var_info\x2efish\x1e/Users/bogdan/\x2econfig/fish/functions/_fzf_preview_file\x2efish\x1e/Users/bogdan/\x2econfig/fish/functions/_fzf_report_file_type\x2efish\x1e/Users/bogdan/\x2econfig/fish/functions/_fzf_search_directory\x2efish\x1e/Users/bogdan/\x2econfig/fish/functions/_fzf_search_git_log\x2efish\x1e/Users/bogdan/\x2econfig/fish/functions/_fzf_search_git_status\x2efish\x1e/Users/bogdan/\x2econfig/fish/functions/_fzf_search_history\x2efish\x1e/Users/bogdan/\x2econfig/fish/functions/_fzf_search_variables\x2efish\x1e/Users/bogdan/\x2econfig/fish/functions/_fzf_wrapper\x2efish\x1e/Users/bogdan/\x2econfig/fish/functions/fzf_configure_bindings\x2efish\x1e/Users/bogdan/\x2econfig/fish/conf\x2ed/fzf\x2efish\x1e/Users/bogdan/\x2econfig/fish/completions/fzf_configure_bindings\x2efish +SETUVAR _fisher_edc_2F_bass_files:/Users/bogdan/\x2econfig/fish/functions/__bass\x2epy\x1e/Users/bogdan/\x2econfig/fish/functions/bass\x2efish +SETUVAR _fisher_evanlucas_2F_fish_2D_kubectl_2D_completions_files:/Users/bogdan/\x2econfig/fish/completions/kubectl\x2efish +SETUVAR _fisher_jhillyerd_2F_plugin_2D_git_files:/Users/bogdan/\x2econfig/fish/functions/__git\x2ebranch_has_wip\x2efish\x1e/Users/bogdan/\x2econfig/fish/functions/__git\x2ecurrent_branch\x2efish\x1e/Users/bogdan/\x2econfig/fish/functions/__git\x2edefault_branch\x2efish\x1e/Users/bogdan/\x2econfig/fish/functions/__git\x2edestroy\x2efish\x1e/Users/bogdan/\x2econfig/fish/functions/__git\x2einit\x2efish\x1e/Users/bogdan/\x2econfig/fish/functions/__git\x2ereset\x2efish\x1e/Users/bogdan/\x2econfig/fish/functions/gbage\x2efish\x1e/Users/bogdan/\x2econfig/fish/functions/gbda\x2efish\x1e/Users/bogdan/\x2econfig/fish/functions/gdt\x2efish\x1e/Users/bogdan/\x2econfig/fish/functions/gdv\x2efish\x1e/Users/bogdan/\x2econfig/fish/functions/ggl\x2efish\x1e/Users/bogdan/\x2econfig/fish/functions/ggp\x2efish\x1e/Users/bogdan/\x2econfig/fish/functions/ggpnp\x2efish\x1e/Users/bogdan/\x2econfig/fish/functions/ggsup\x2efish\x1e/Users/bogdan/\x2econfig/fish/functions/ggu\x2efish\x1e/Users/bogdan/\x2econfig/fish/functions/gignored\x2efish\x1e/Users/bogdan/\x2econfig/fish/functions/glp\x2efish\x1e/Users/bogdan/\x2econfig/fish/functions/gpoat\x2efish\x1e/Users/bogdan/\x2econfig/fish/functions/grename\x2efish\x1e/Users/bogdan/\x2econfig/fish/functions/grt\x2efish\x1e/Users/bogdan/\x2econfig/fish/functions/gtl\x2efish\x1e/Users/bogdan/\x2econfig/fish/functions/gunwip\x2efish\x1e/Users/bogdan/\x2econfig/fish/functions/gwip\x2efish\x1e/Users/bogdan/\x2econfig/fish/conf\x2ed/git\x2efish +SETUVAR _fisher_jorgebucaran_2F_fisher_files:/Users/bogdan/\x2econfig/fish/functions/fisher\x2efish\x1e/Users/bogdan/\x2econfig/fish/completions/fisher\x2efish +SETUVAR _fisher_plugins:jorgebucaran/fisher\x1ePatrickF1/fzf\x2efish\x1eevanlucas/fish\x2dkubectl\x2dcompletions\x1eedc/bass\x1ejhillyerd/plugin\x2dgit +SETUVAR fish_color_autosuggestion:555\x1ebrblack +SETUVAR fish_color_cancel:\x2dr +SETUVAR fish_color_command:005fd7 +SETUVAR fish_color_comment:990000 +SETUVAR fish_color_cwd:green +SETUVAR fish_color_cwd_root:red +SETUVAR fish_color_end:009900 +SETUVAR fish_color_error:ff0000 +SETUVAR fish_color_escape:00a6b2 +SETUVAR fish_color_history_current:\x2d\x2dbold +SETUVAR fish_color_host:normal +SETUVAR fish_color_host_remote:yellow +SETUVAR fish_color_normal:normal +SETUVAR fish_color_operator:00a6b2 +SETUVAR fish_color_param:00afff +SETUVAR fish_color_quote:999900 +SETUVAR fish_color_redirection:00afff +SETUVAR fish_color_search_match:bryellow\x1e\x2d\x2dbackground\x3dbrblack +SETUVAR fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack +SETUVAR fish_color_status:red +SETUVAR fish_color_user:brgreen +SETUVAR fish_color_valid_path:\x2d\x2dunderline +SETUVAR fish_key_bindings:fish_default_key_bindings +SETUVAR fish_pager_color_completion:\x1d +SETUVAR fish_pager_color_description:B3A06D\x1eyellow +SETUVAR fish_pager_color_prefix:normal\x1e\x2d\x2dbold\x1e\x2d\x2dunderline +SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan +SETUVAR fish_user_paths:/Users/bogdan/\x2epoetry/bin diff --git a/fish/functions/__bass.py b/fish/functions/__bass.py new file mode 100644 index 0000000..3fe17fc --- /dev/null +++ b/fish/functions/__bass.py @@ -0,0 +1,138 @@ +""" +To be used with a companion fish function like this: + + function refish + set -l _x (python /tmp/bass.py source ~/.nvm/nvim.sh ';' nvm use iojs); source $_x; and rm -f $_x + end + +""" + +from __future__ import print_function + +import json +import os +import signal +import subprocess +import sys +import traceback + + +BASH = 'bash' + +FISH_READONLY = [ + 'PWD', 'SHLVL', 'history', 'pipestatus', 'status', 'version', + 'FISH_VERSION', 'fish_pid', 'hostname', '_', 'fish_private_mode' +] + +IGNORED = [ + 'PS1', 'XPC_SERVICE_NAME' +] + +def ignored(name): + if name == 'PWD': # this is read only, but has special handling + return False + # ignore other read only variables + if name in FISH_READONLY: + return True + if name in IGNORED or name.startswith("BASH_FUNC"): + return True + return False + +def escape(string): + # use json.dumps to reliably escape quotes and backslashes + return json.dumps(string).replace(r'$', r'\$') + +def escape_identifier(word): + return escape(word.replace('?', '\\?')) + +def comment(string): + return '\n'.join(['# ' + line for line in string.split('\n')]) + +def gen_script(): + # Use the following instead of /usr/bin/env to read environment so we can + # deal with multi-line environment variables (and other odd cases). + env_reader = "%s -c 'import os,json; print(json.dumps({k:v for k,v in os.environ.items()}))'" % (sys.executable) + args = [BASH, '-c', env_reader] + output = subprocess.check_output(args, universal_newlines=True) + old_env = output.strip() + + pipe_r, pipe_w = os.pipe() + if sys.version_info >= (3, 4): + os.set_inheritable(pipe_w, True) + command = 'eval $1 && ({}; alias) >&{}'.format( + env_reader, + pipe_w + ) + args = [BASH, '-c', command, 'bass', ' '.join(sys.argv[1:])] + p = subprocess.Popen(args, universal_newlines=True, close_fds=False) + os.close(pipe_w) + with os.fdopen(pipe_r) as f: + new_env = f.readline() + alias_str = f.read() + if p.wait() != 0: + raise subprocess.CalledProcessError( + returncode=p.returncode, + cmd=' '.join(sys.argv[1:]), + output=new_env + alias_str + ) + new_env = new_env.strip() + + old_env = json.loads(old_env) + new_env = json.loads(new_env) + + script_lines = [] + + for k, v in new_env.items(): + if ignored(k): + continue + v1 = old_env.get(k) + if not v1: + script_lines.append(comment('adding %s=%s' % (k, v))) + elif v1 != v: + script_lines.append(comment('updating %s=%s -> %s' % (k, v1, v))) + # process special variables + if k == 'PWD': + script_lines.append('cd %s' % escape(v)) + continue + else: + continue + if k == 'PATH': + value = ' '.join([escape(directory) + for directory in v.split(':')]) + else: + value = escape(v) + script_lines.append('set -g -x %s %s' % (k, value)) + + for var in set(old_env.keys()) - set(new_env.keys()): + script_lines.append(comment('removing %s' % var)) + script_lines.append('set -e %s' % var) + + script = '\n'.join(script_lines) + + alias_lines = [] + for line in alias_str.splitlines(): + _, rest = line.split(None, 1) + k, v = rest.split("=", 1) + alias_lines.append("alias " + escape_identifier(k) + "=" + v) + alias = '\n'.join(alias_lines) + + return script + '\n' + alias + +script_file = os.fdopen(3, 'w') + +if not sys.argv[1:]: + print('__bass_usage', file=script_file, end='') + sys.exit(0) + +try: + script = gen_script() +except subprocess.CalledProcessError as e: + sys.exit(e.returncode) +except Exception: + print('Bass internal error!', file=sys.stderr) + raise # traceback will output to stderr +except KeyboardInterrupt: + signal.signal(signal.SIGINT, signal.SIG_DFL) + os.kill(os.getpid(), signal.SIGINT) +else: + script_file.write(script) diff --git a/fish/functions/__git.branch_has_wip.fish b/fish/functions/__git.branch_has_wip.fish new file mode 100644 index 0000000..60dc37f --- /dev/null +++ b/fish/functions/__git.branch_has_wip.fish @@ -0,0 +1,3 @@ +function __git.branch_has_wip -d "Returns 0 if branch has --wip--, otherwise 1" + git log -n 1 2>/dev/null | grep -qc "\-\-wip\-\-" +end diff --git a/fish/functions/__git.current_branch.fish b/fish/functions/__git.current_branch.fish new file mode 100644 index 0000000..34f5324 --- /dev/null +++ b/fish/functions/__git.current_branch.fish @@ -0,0 +1,6 @@ +function __git.current_branch -d "Output git's current branch name" + begin + git symbolic-ref HEAD; or \ + git rev-parse --short HEAD; or return + end 2>/dev/null | sed -e 's|^refs/heads/||' +end diff --git a/fish/functions/__git.default_branch.fish b/fish/functions/__git.default_branch.fish new file mode 100644 index 0000000..c5574ac --- /dev/null +++ b/fish/functions/__git.default_branch.fish @@ -0,0 +1,11 @@ +function __git.default_branch -d "Fallback to main when master branch is not found" + command git rev-parse --git-dir &>/dev/null; or return + if set -l default_branch (command git config --get init.defaultBranch) + and command git show-ref -q --verify refs/heads/{$default_branch} + echo $default_branch + else if command git show-ref -q --verify refs/heads/master + echo master + else + echo main + end +end diff --git a/fish/functions/__git.destroy.fish b/fish/functions/__git.destroy.fish new file mode 100644 index 0000000..421e19b --- /dev/null +++ b/fish/functions/__git.destroy.fish @@ -0,0 +1,7 @@ +function __git.destroy + for ab in $__git_plugin_abbreviations + abbr -e $ab + end + set -Ue __git_plugin_abbreviations + set -Ue __git_plugin_initialized +end diff --git a/fish/functions/__git.init.fish b/fish/functions/__git.init.fish new file mode 100644 index 0000000..4d289f1 --- /dev/null +++ b/fish/functions/__git.init.fish @@ -0,0 +1,166 @@ +function __git.init + function __git.create_abbr -d "Create Git plugin abbreviation" + set -l name $argv[1] + set -l body $argv[2..-1] + abbr -a $name $body + set -a __git_plugin_abbreviations $name + end + + set -q __git_plugin_initialized; and return 0 + + set -U __git_plugin_abbreviations + + # git abbreviations + __git.create_abbr g git + __git.create_abbr ga git add + __git.create_abbr gaa git add --all + __git.create_abbr gapa git add --patch + __git.create_abbr gap git apply + __git.create_abbr gb git branch -vv + __git.create_abbr gba git branch -a -v + __git.create_abbr gban git branch -a -v --no-merged + __git.create_abbr gbd git branch -d + __git.create_abbr gbD git branch -D + __git.create_abbr gbl git blame -b -w + __git.create_abbr gbs git bisect + __git.create_abbr gbsb git bisect bad + __git.create_abbr gbsg git bisect good + __git.create_abbr gbsr git bisect reset + __git.create_abbr gbss git bisect start + __git.create_abbr gc git commit -v + __git.create_abbr gc! git commit -v --amend + __git.create_abbr gcn! git commit -v --no-edit --amend + __git.create_abbr gca git commit -v -a + __git.create_abbr gca! git commit -v -a --amend + __git.create_abbr gcan! git commit -v -a --no-edit --amend + __git.create_abbr gcv git commit -v --no-verify + __git.create_abbr gcav git commit -a -v --no-verify + __git.create_abbr gcav! git commit -a -v --no-verify --amend + __git.create_abbr gcm git commit -m + __git.create_abbr gcam git commit -a -m + __git.create_abbr gscam git commit -S -a -m + __git.create_abbr gcfx git commit --fixup + __git.create_abbr gcf git config --list + __git.create_abbr gcl git clone + __git.create_abbr gclean git clean -di + __git.create_abbr gclean! git clean -dfx + __git.create_abbr gclean!! "git reset --hard; and git clean -dfx" + __git.create_abbr gcount git shortlog -sn + __git.create_abbr gcp git cherry-pick + __git.create_abbr gcpa git cherry-pick --abort + __git.create_abbr gcpc git cherry-pick --continue + __git.create_abbr gd git diff + __git.create_abbr gdca git diff --cached + __git.create_abbr gds git diff --stat + __git.create_abbr gdsc git diff --stat --cached + __git.create_abbr gdw git diff --word-diff + __git.create_abbr gdwc git diff --word-diff --cached + __git.create_abbr gdto git difftool + __git.create_abbr gignore git update-index --assume-unchanged + __git.create_abbr gf git fetch + __git.create_abbr gfa git fetch --all --prune + __git.create_abbr gfm "git fetch origin (__git.default_branch) --prune; and git merge FETCH_HEAD" + __git.create_abbr gfo git fetch origin + __git.create_abbr gl git pull + __git.create_abbr gll git pull origin + __git.create_abbr glr git pull --rebase + __git.create_abbr glg git log --stat --max-count=10 + __git.create_abbr glgg git log --graph --max-count=10 + __git.create_abbr glgga git log --graph --decorate --all + __git.create_abbr glo git log --oneline --decorate --color + __git.create_abbr glog git log --oneline --decorate --color --graph + __git.create_abbr glom git log --oneline --decorate --color \(__git.default_branch\).. + __git.create_abbr glod git log --oneline --decorate --color develop.. + __git.create_abbr gloo "git log --pretty=format:'%C(yellow)%h %Cred%ad %Cblue%an%Cgreen%d %Creset%s' --date=short" + __git.create_abbr gm git merge + __git.create_abbr gmt git mergetool --no-prompt + __git.create_abbr gp git push + __git.create_abbr gp! git push --force-with-lease + __git.create_abbr gpo git push origin + __git.create_abbr gpo! git push --force-with-lease origin + __git.create_abbr gpv git push --no-verify + __git.create_abbr gpv! git push --no-verify --force-with-lease + __git.create_abbr ggp! ggp --force-with-lease + __git.create_abbr gpu ggp --set-upstream + __git.create_abbr gr git remote -vv + __git.create_abbr gra git remote add + __git.create_abbr grb git rebase + __git.create_abbr grba git rebase --abort + __git.create_abbr grbc git rebase --continue + __git.create_abbr grbi git rebase --interactive + __git.create_abbr grbm git rebase \(__git.default_branch\) + __git.create_abbr grbmi git rebase \(__git.default_branch\) --interactive + __git.create_abbr grbmia git rebase \(__git.default_branch\) --interactive --autosquash + __git.create_abbr grbd git rebase develop + __git.create_abbr grbdi git rebase develop --interactive + __git.create_abbr grbdia git rebase develop --interactive --autosquash + __git.create_abbr grbs git rebase --skip + __git.create_abbr grev git revert + __git.create_abbr grh git reset + __git.create_abbr grhh git reset --hard + __git.create_abbr grhpa git reset --patch + __git.create_abbr grm git rm + __git.create_abbr grmc git rm --cached + __git.create_abbr grmv git remote rename + __git.create_abbr grrm git remote remove + __git.create_abbr grs git restore + __git.create_abbr grset git remote set-url + __git.create_abbr grss git restore --source + __git.create_abbr grup git remote update + __git.create_abbr grv git remote -v + __git.create_abbr gsh git show + __git.create_abbr gsd git svn dcommit + __git.create_abbr gsr git svn rebase + __git.create_abbr gss git status -s + __git.create_abbr gst git status + __git.create_abbr gsta git stash + __git.create_abbr gstd git stash drop + __git.create_abbr gstp git stash pop + __git.create_abbr gsts git stash show --text + __git.create_abbr gsu git submodule update + __git.create_abbr gsur git submodule update --recursive + __git.create_abbr gsuri git submodule update --recursive --init + __git.create_abbr gts git tag -s + __git.create_abbr gtv git tag | sort -V + __git.create_abbr gsw git switch + __git.create_abbr gswc git switch --create + __git.create_abbr gunignore git update-index --no-assume-unchanged + __git.create_abbr gup git pull --rebase + __git.create_abbr gupv git pull --rebase -v + __git.create_abbr gupa git pull --rebase --autostash + __git.create_abbr gupav git pull --rebase --autostash -v + __git.create_abbr gwch git whatchanged -p --abbrev-commit --pretty=medium + + # git checkout abbreviations + __git.create_abbr gco git checkout + __git.create_abbr gcb git checkout -b + __git.create_abbr gcod git checkout develop + __git.create_abbr gcom git checkout \(__git.default_branch\) + + # git flow abbreviations + __git.create_abbr gfb git flow bugfix + __git.create_abbr gff git flow feature + __git.create_abbr gfr git flow release + __git.create_abbr gfh git flow hotfix + __git.create_abbr gfs git flow support + + __git.create_abbr gfbs git flow bugfix start + __git.create_abbr gffs git flow feature start + __git.create_abbr gfrs git flow release start + __git.create_abbr gfhs git flow hotfix start + __git.create_abbr gfss git flow support start + + __git.create_abbr gfbt git flow bugfix track + __git.create_abbr gfft git flow feature track + __git.create_abbr gfrt git flow release track + __git.create_abbr gfht git flow hotfix track + __git.create_abbr gfst git flow support track + + __git.create_abbr gfp git flow publish + + # Cleanup declared functions + functions -e __git.create_abbr + + # Mark git plugin as initialized + set -U __git_plugin_initialized (date) +end diff --git a/fish/functions/__git.reset.fish b/fish/functions/__git.reset.fish new file mode 100644 index 0000000..df2642f --- /dev/null +++ b/fish/functions/__git.reset.fish @@ -0,0 +1,3 @@ +function __git.reset + __git.destroy; and __git.init +end diff --git a/fish/functions/_fzf_configure_bindings_help.fish b/fish/functions/_fzf_configure_bindings_help.fish new file mode 100644 index 0000000..02e1860 --- /dev/null +++ b/fish/functions/_fzf_configure_bindings_help.fish @@ -0,0 +1,42 @@ +function _fzf_configure_bindings_help --description "Prints the help message for fzf_configure_bindings." + echo "\ +USAGE: + fzf_configure_bindings [--FEATURE[=KEY_SEQUENCE]...] + +DESCRIPTION + By default, fzf_configure_bindings installs mnemonic key bindings for fzf.fish's features. Each + feature's binding can be customized through a corresponding namesake option: + FEATURE | MNEMONIC KEY SEQUENCE | CORRESPONDING OPTION + Search directory | Ctrl+Alt+F (F for file) | --directory + Search git log | Ctrl+Alt+L (L for log) | --git_log + Search git status | Ctrl+Alt+S (S for status) | --git_status + Search history | Ctrl+R (R for reverse) | --history + Search variables | Ctrl+V (V for variable) | --variables + An option with a key sequence value overrides the binding for its feature, while an option + without a value disables the binding. A feature that is not customized retains its default + menomonic binding specified above. Key bindings are installed for default and insert modes. + + In terms of validation, fzf_configure_bindings fails if passed unknown options. Furthermore, it + expects an equals sign between an option's name and value. However, it does not validate key + sequences. Rather, consider using fish_key_reader to manually validate them. + + In terms of experimentation, fzf_configure_bindings erases any bindings it previously installed + before installing new ones so it can be repeatedly executed in the same fish session without + problem. Once the desired fzf_configure_bindings command has been found, add it to config.fish + in order to persist the bindings. + + The -h and --help options print this help message. + +EXAMPLES + Install the default mnemonic bindings + \$ fzf_configure_bindings + Install the default bindings but override git log's binding to Ctrl+G + \$ fzf_configure_bindings --git_log=\cg + Install the default bindings but leave search history unbound + \$ fzf_configure_bindings --history + Alternative style of disabling search history + \$ fzf_configure_bindings --history= + An agglomeration of all the options + \$ fzf_configure_bindings --git_status=\cg --history=\ch --variables --directory --git_log +" +end diff --git a/fish/functions/_fzf_extract_var_info.fish b/fish/functions/_fzf_extract_var_info.fish new file mode 100644 index 0000000..716416c --- /dev/null +++ b/fish/functions/_fzf_extract_var_info.fish @@ -0,0 +1,15 @@ +# helper function for _fzf_search_variables +function _fzf_extract_var_info --argument-names variable_name set_show_output --description "Extract and reformat lines pertaining to \$variable_name from \$set_show_output." + # Extract only the lines about the variable, all of which begin with either + # $variable_name: ...or... $variable_name[ + string match --regex "^\\\$$variable_name(?::|\[).*" <$set_show_output | + + # Strip the variable name prefix, including ": " for scope info lines + string replace --regex "^\\\$$variable_name(?:: )?" '' | + + # Distill the lines of values, replacing... + # [1]: |value| + # ...with... + # [1] value + string replace --regex ": \|(.*)\|" ' \$1' +end diff --git a/fish/functions/_fzf_preview_file.fish b/fish/functions/_fzf_preview_file.fish new file mode 100644 index 0000000..29e7405 --- /dev/null +++ b/fish/functions/_fzf_preview_file.fish @@ -0,0 +1,43 @@ +# helper function for _fzf_search_directory +function _fzf_preview_file --description "Print a preview for the given file based on its file type." + # because there's no way to guarantee that _fzf_search_directory passes the path to _fzf_preview_file + # as one argument, we collect all the arguments into one single variable and treat that as the path + set file_path $argv + + if test -L "$file_path" # symlink + # notify user and recurse on the target of the symlink, which can be any of these file types + set -l target_path (realpath "$file_path") + + set_color yellow + echo "'$file_path' is a symlink to '$target_path'." + set_color normal + + _fzf_preview_file "$target_path" + else if test -f "$file_path" # regular file + if set --query fzf_preview_file_cmd + # need to escape quotes to make sure eval receives file_path as a single arg + eval "$fzf_preview_file_cmd '$file_path'" + else + bat --style=numbers --color=always "$file_path" + end + else if test -d "$file_path" # directory + if set --query fzf_preview_dir_cmd + # see above + eval "$fzf_preview_dir_cmd '$file_path'" + else + # -A list hidden files as well, except for . and .. + # -F helps classify files by appending symbols after the file name + command ls -A -F "$file_path" + end + else if test -c "$file_path" + _fzf_report_file_type "$file_path" "character device file" + else if test -b "$file_path" + _fzf_report_file_type "$file_path" "block device file" + else if test -S "$file_path" + _fzf_report_file_type "$file_path" socket + else if test -p "$file_path" + _fzf_report_file_type "$file_path" "named pipe" + else + echo "$file_path doesn't exist." >&2 + end +end diff --git a/fish/functions/_fzf_report_file_type.fish b/fish/functions/_fzf_report_file_type.fish new file mode 100644 index 0000000..49e02e1 --- /dev/null +++ b/fish/functions/_fzf_report_file_type.fish @@ -0,0 +1,6 @@ +# helper function for _fzf_preview_file +function _fzf_report_file_type --argument-names file_path file_type --description "Explain the file type for a file." + set_color red + echo "Cannot preview '$file_path': it is a $file_type." + set_color normal +end diff --git a/fish/functions/_fzf_search_directory.fish b/fish/functions/_fzf_search_directory.fish new file mode 100644 index 0000000..40b9c95 --- /dev/null +++ b/fish/functions/_fzf_search_directory.fish @@ -0,0 +1,41 @@ +function _fzf_search_directory --description "Search the current directory. Replace the current token with the selected file paths." + set fd_opts --color=always $fzf_fd_opts + set fzf_arguments --multi --ansi $fzf_dir_opts + set token (commandline --current-token) + # expand any variables or leading tilde (~) in the token + set expanded_token (eval echo -- $token) + # unescape token because it's already quoted so backslashes will mess up the path + set unescaped_exp_token (string unescape -- $expanded_token) + + # If the current token is a directory and has a trailing slash, + # then use it as fd's base directory. + if string match --quiet -- "*/" $unescaped_exp_token && test -d "$unescaped_exp_token" + set --append fd_opts --base-directory=$unescaped_exp_token + # use the directory name as fzf's prompt to indicate the search is limited to that directory + set --prepend fzf_arguments --prompt="$unescaped_exp_token" --preview="_fzf_preview_file $expanded_token{}" + set file_paths_selected $unescaped_exp_token(fd $fd_opts 2>/dev/null | _fzf_wrapper $fzf_arguments) + else + set --prepend fzf_arguments --query="$unescaped_exp_token" --preview='_fzf_preview_file {}' + set file_paths_selected (fd $fd_opts 2>/dev/null | _fzf_wrapper $fzf_arguments) + end + + + if test $status -eq 0 + # Fish will cd implicitly if a directory name ending in a slash is provided. + # To help the user leverage this feature, we automatically append / to the selected path if + # - only one path was selected, + # - the user was in the middle of inputting the first token, + # - the path is a directory + # Then, the user only needs to hit Enter once more to cd into that directory. + if test (count $file_paths_selected) = 1 + set commandline_tokens (commandline --tokenize) + if test "$commandline_tokens" = "$token" -a -d "$file_paths_selected" + set file_paths_selected $file_paths_selected/ + end + end + + commandline --current-token --replace -- (string escape -- $file_paths_selected | string join ' ') + end + + commandline --function repaint +end diff --git a/fish/functions/_fzf_search_git_log.fish b/fish/functions/_fzf_search_git_log.fish new file mode 100644 index 0000000..a2fd454 --- /dev/null +++ b/fish/functions/_fzf_search_git_log.fish @@ -0,0 +1,24 @@ +function _fzf_search_git_log --description "Search the output of git log and preview commits. Replace the current token with the selected commit hash." + if not git rev-parse --git-dir >/dev/null 2>&1 + echo '_fzf_search_git_log: Not in a git repository.' >&2 + else + # see documentation for git format placeholders at https://git-scm.com/docs/git-log#Documentation/git-log.txt-emnem + # %h gives you the abbreviated commit hash, which is useful for saving screen space, but we will have to expand it later below + set log_fmt_str '%C(bold blue)%h%C(reset) - %C(cyan)%ad%C(reset) %C(yellow)%d%C(reset) %C(normal)%s%C(reset) %C(dim normal)[%an]%C(reset)' + set selected_log_line ( + git log --color=always --format=format:$log_fmt_str --date=short | \ + _fzf_wrapper --ansi \ + --tiebreak=index \ + --preview='git show --color=always {1}' \ + --query=(commandline --current-token) \ + $fzf_git_log_opts + ) + if test $status -eq 0 + set abbreviated_commit_hash (string split --max 1 " " $selected_log_line)[1] + set commit_hash (git rev-parse $abbreviated_commit_hash) + commandline --current-token --replace $commit_hash + end + end + + commandline --function repaint +end diff --git a/fish/functions/_fzf_search_git_status.fish b/fish/functions/_fzf_search_git_status.fish new file mode 100644 index 0000000..da77fe2 --- /dev/null +++ b/fish/functions/_fzf_search_git_status.fish @@ -0,0 +1,33 @@ +function _fzf_search_git_status --description "Search the output of git status. Replace the current token with the selected file paths." + if not git rev-parse --git-dir >/dev/null 2>&1 + echo '_fzf_search_git_status: Not in a git repository.' >&2 + else + set selected_paths ( + # Pass configuration color.status=always to force status to use colors even though output is sent to a pipe + git -c color.status=always status --short | + _fzf_wrapper --ansi \ + --multi \ + --query=(commandline --current-token) \ + $fzf_git_status_opts + ) + if test $status -eq 0 + # git status --short automatically escapes the paths of most files for us so not going to bother trying to handle + # the few edges cases of weird file names that should be extremely rare (e.g. "this;needs;escaping") + set cleaned_paths + + for path in $selected_paths + if test (string sub --length 1 $path) = R + # path has been renamed and looks like "R LICENSE -> LICENSE.md" + # extract the path to use from after the arrow + set --append cleaned_paths (string split -- "-> " $path)[-1] + else + set --append cleaned_paths (string sub --start=4 $path) + end + end + + commandline --current-token --replace -- (string escape -- $cleaned_paths | string join ' ') + end + end + + commandline --function repaint +end diff --git a/fish/functions/_fzf_search_history.fish b/fish/functions/_fzf_search_history.fish new file mode 100644 index 0000000..271cfcc --- /dev/null +++ b/fish/functions/_fzf_search_history.fish @@ -0,0 +1,24 @@ +function _fzf_search_history --description "Search command history. Replace the command line with the selected command." + # history merge incorporates history changes from other fish sessions + builtin history merge + + set command_with_ts ( + # Reference https://devhints.io/strftime to understand strftime format symbols + builtin history --null --show-time="%m-%d %H:%M:%S │ " | + _fzf_wrapper --read0 \ + --tiebreak=index \ + --query=(commandline) \ + # preview current command using fish_ident in a window at the bottom 3 lines tall + --preview="echo -- {4..} | fish_indent --ansi" \ + --preview-window="bottom:3:wrap" \ + $fzf_history_opts | + string collect + ) + + if test $status -eq 0 + set command_selected (string split --max 1 " │ " $command_with_ts)[2] + commandline --replace -- $command_selected + end + + commandline --function repaint +end diff --git a/fish/functions/_fzf_search_variables.fish b/fish/functions/_fzf_search_variables.fish new file mode 100644 index 0000000..ef57940 --- /dev/null +++ b/fish/functions/_fzf_search_variables.fish @@ -0,0 +1,45 @@ +# This function expects the following two arguments: +# argument 1 = output of (set --show | psub), i.e. a file with the scope info and values of all variables +# argument 2 = output of (set --names | psub), i.e. a file with all variable names +function _fzf_search_variables --argument-names set_show_output set_names_output --description "Search and preview shell variables. Replace the current token with the selected variable." + if test -z "$set_names_output" + printf '%s\n' '_fzf_search_variables requires 2 arguments.' >&2 + + commandline --function repaint + return 22 # 22 means invalid argument in POSIX + end + + # Exclude the history variable from being piped into fzf because + # 1. it's not included in $set_names_output + # 2. it tends to be a very large value => increases computation time + # 3._fzf_search_history is a much better way to examine history anyway + set all_variable_names (string match --invert history <$set_names_output) + + set current_token (commandline --current-token) + # Use the current token to pre-populate fzf's query. If the current token begins + # with a $, remove it from the query so that it will better match the variable names + set cleaned_curr_token (string replace -- '$' '' $current_token) + + set variable_names_selected ( + printf '%s\n' $all_variable_names | + _fzf_wrapper --preview "_fzf_extract_var_info {} $set_show_output" \ + --multi \ + --query=$cleaned_curr_token \ + $fzf_shell_vars_opts + ) + + if test $status -eq 0 + # If the current token begins with a $, do not overwrite the $ when + # replacing the current token with the selected variable. + # Uses brace expansion to prepend $ to each variable name. + commandline --current-token --replace ( + if string match --quiet -- '$*' $current_token + string join " " \${$variable_names_selected} + else + string join " " $variable_names_selected + end + ) + end + + commandline --function repaint +end diff --git a/fish/functions/_fzf_wrapper.fish b/fish/functions/_fzf_wrapper.fish new file mode 100644 index 0000000..a928701 --- /dev/null +++ b/fish/functions/_fzf_wrapper.fish @@ -0,0 +1,20 @@ +function _fzf_wrapper --description "Prepares some environment variables before executing fzf." + # Make sure fzf uses fish to execute preview commands, some of which + # are autoloaded fish functions so don't exist in other shells. + # Use --local so that it doesn't clobber SHELL outside of this function. + set --local --export SHELL (command --search fish) + + # If FZF_DEFAULT_OPTS is not set, then set some sane defaults. + # See https://github.com/junegunn/fzf#environment-variables + if not set --query FZF_DEFAULT_OPTS + # cycle allows jumping between the first and last results, making scrolling faster + # layout=reverse lists results top to bottom, mimicking the familiar layouts of git log, history, and env + # border shows where the fzf window begins and ends + # height=90% leaves space to see the current command and some scrollback, maintaining context of work + # preview-window=wrap wraps long lines in the preview window, making reading easier + # marker=* makes the multi-select marker more distinguishable from the pointer (since both default to >) + set --export FZF_DEFAULT_OPTS '--cycle --layout=reverse --border --height=90% --preview-window=wrap --marker="*"' + end + + fzf $argv +end diff --git a/fish/functions/bass.fish b/fish/functions/bass.fish new file mode 100644 index 0000000..2b3af16 --- /dev/null +++ b/fish/functions/bass.fish @@ -0,0 +1,29 @@ +function bass + set -l bash_args $argv + set -l bass_debug + if test "$bash_args[1]_" = '-d_' + set bass_debug true + set -e bash_args[1] + end + + set -l script_file (mktemp) + if command -v python3 >/dev/null 2>&1 + command python3 -sS (dirname (status -f))/__bass.py $bash_args 3>$script_file + else + command python -sS (dirname (status -f))/__bass.py $bash_args 3>$script_file + end + set -l bass_status $status + if test $bass_status -ne 0 + return $bass_status + end + + if test -n "$bass_debug" + cat $script_file + end + source $script_file + command rm $script_file +end + +function __bass_usage + echo "Usage: bass [-d] " +end diff --git a/fish/functions/fish_prompt.fish b/fish/functions/fish_prompt.fish new file mode 100644 index 0000000..5ab27cf --- /dev/null +++ b/fish/functions/fish_prompt.fish @@ -0,0 +1,14 @@ +# Green and red depending on exit status. + +function fish_prompt + if [ $status = 0 ] + set_color green + else + set_color red + end + + echo -n '≫' + + set_color normal + echo -n ' ' +end diff --git a/fish/functions/fisher.fish b/fish/functions/fisher.fish new file mode 100644 index 0000000..a1fb6cf --- /dev/null +++ b/fish/functions/fisher.fish @@ -0,0 +1,209 @@ +function fisher --argument-names cmd --description "A plugin manager for Fish" + set --query fisher_path || set --local fisher_path $__fish_config_dir + set --local fisher_version 4.3.0 + set --local fish_plugins $__fish_config_dir/fish_plugins + + switch "$cmd" + case -v --version + echo "fisher, version $fisher_version" + case "" -h --help + echo "Usage: fisher install Install plugins" + echo " fisher remove Remove installed plugins" + echo " fisher update Update installed plugins" + echo " fisher update Update all installed plugins" + echo " fisher list [] List installed plugins matching regex" + echo "Options:" + echo " -v or --version Print version" + echo " -h or --help Print this help message" + case ls list + string match --entire --regex -- "$argv[2]" $_fisher_plugins + case install update remove + isatty || read --local --null --array stdin && set --append argv $stdin + + set --local install_plugins + set --local update_plugins + set --local remove_plugins + set --local arg_plugins $argv[2..-1] + set --local old_plugins $_fisher_plugins + set --local new_plugins + + if ! set --query argv[2] + if test "$cmd" != update + echo "fisher: Not enough arguments for command: \"$cmd\"" >&2 && return 1 + else if test ! -e $fish_plugins + echo "fisher: \"$fish_plugins\" file not found: \"$cmd\"" >&2 && return 1 + end + set arg_plugins (string match --regex -- '^[^\s]+$' <$fish_plugins) + end + + for plugin in $arg_plugins + test -e "$plugin" && set plugin (realpath $plugin) + contains -- "$plugin" $new_plugins || set --append new_plugins $plugin + end + + if set --query argv[2] + for plugin in $new_plugins + if contains -- "$plugin" $old_plugins + test "$cmd" = remove && + set --append remove_plugins $plugin || + set --append update_plugins $plugin + else if test "$cmd" = install + set --append install_plugins $plugin + else + echo "fisher: Plugin not installed: \"$plugin\"" >&2 && return 1 + end + end + else + for plugin in $new_plugins + contains -- "$plugin" $old_plugins && + set --append update_plugins $plugin || + set --append install_plugins $plugin + end + + for plugin in $old_plugins + contains -- "$plugin" $new_plugins || set --append remove_plugins $plugin + end + end + + set --local pid_list + set --local source_plugins + set --local fetch_plugins $update_plugins $install_plugins + echo (set_color --bold)fisher $cmd version $fisher_version(set_color normal) + + for plugin in $fetch_plugins + set --local source (command mktemp -d) + set --append source_plugins $source + + command mkdir -p $source/{completions,conf.d,functions} + + fish --command " + if test -e $plugin + command cp -Rf $plugin/* $source + else + set temp (command mktemp -d) + set name (string split \@ $plugin) || set name[2] HEAD + set url https://codeload.github.com/\$name[1]/tar.gz/\$name[2] + + echo Fetching (set_color --underline)\$url(set_color normal) + + if curl --silent \$url | tar -xzC \$temp -f - 2>/dev/null + command cp -Rf \$temp/*/* $source + else + echo fisher: Invalid plugin name or host unavailable: \\\"$plugin\\\" >&2 + command rm -rf $source + end + command rm -rf \$temp + end + + set files $source/* && string match --quiet --regex -- .+\.fish\\\$ \$files + " & + + set --append pid_list (jobs --last --pid) + end + + wait $pid_list 2>/dev/null + + for plugin in $fetch_plugins + if set --local source $source_plugins[(contains --index -- "$plugin" $fetch_plugins)] && test ! -e $source + if set --local index (contains --index -- "$plugin" $install_plugins) + set --erase install_plugins[$index] + else + set --erase update_plugins[(contains --index -- "$plugin" $update_plugins)] + end + end + end + + for plugin in $update_plugins $remove_plugins + if set --local index (contains --index -- "$plugin" $_fisher_plugins) + set --local plugin_files_var _fisher_(string escape --style=var -- $plugin)_files + + if contains -- "$plugin" $remove_plugins + for name in (string replace --filter --regex -- '.+/conf\.d/([^/]+)\.fish$' '$1' $$plugin_files_var) + emit {$name}_uninstall + end + printf "%s\n" Removing\ (set_color red --bold)$plugin(set_color normal) " "$$plugin_files_var + end + + command rm -rf $$plugin_files_var + functions --erase (string replace --filter --regex -- '.+/functions/([^/]+)\.fish$' '$1' $$plugin_files_var) + + for name in (string replace --filter --regex -- '.+/completions/([^/]+)\.fish$' '$1' $$plugin_files_var) + complete --erase --command $name + end + + set --erase _fisher_plugins[$index] + set --erase $plugin_files_var + end + end + + if set --query update_plugins[1] || set --query install_plugins[1] + command mkdir -p $fisher_path/{functions,conf.d,completions} + end + + for plugin in $update_plugins $install_plugins + set --local source $source_plugins[(contains --index -- "$plugin" $fetch_plugins)] + set --local files $source/{functions,conf.d,completions}/* + + if set --local index (contains --index -- $plugin $install_plugins) + set --local user_files $fisher_path/{functions,conf.d,completions}/* + set --local conflict_files + + for file in (string replace -- $source/ $fisher_path/ $files) + contains -- $file $user_files && set --append conflict_files $file + end + + if set --query conflict_files[1] && set --erase install_plugins[$index] + echo -s "fisher: Cannot install \"$plugin\": please remove or move conflicting files first:" \n" "$conflict_files >&2 + continue + end + end + + for file in (string replace -- $source/ "" $files) + command cp -Rf $source/$file $fisher_path/$file + end + + set --local plugin_files_var _fisher_(string escape --style=var -- $plugin)_files + set --query files[1] && set --universal $plugin_files_var (string replace -- $source $fisher_path $files) + + contains -- $plugin $_fisher_plugins || set --universal --append _fisher_plugins $plugin + contains -- $plugin $install_plugins && set --local event install || set --local event update + + printf "%s\n" Installing\ (set_color --bold)$plugin(set_color normal) " "$$plugin_files_var + + for file in (string match --regex -- '.+/[^/]+\.fish$' $$plugin_files_var) + source $file + if set --local name (string replace --regex -- '.+conf\.d/([^/]+)\.fish$' '$1' $file) + emit {$name}_$event + end + end + end + + command rm -rf $source_plugins + + set --query _fisher_plugins[1] || set --erase _fisher_plugins + set --query _fisher_plugins && + printf "%s\n" $_fisher_plugins >$fish_plugins || + command rm -f $fish_plugins + + set --local total (count $install_plugins) (count $update_plugins) (count $remove_plugins) + test "$total" != "0 0 0" && echo (string join ", " ( + test $total[1] = 0 || echo "Installed $total[1]") ( + test $total[2] = 0 || echo "Updated $total[2]") ( + test $total[3] = 0 || echo "Removed $total[3]") + ) plugin/s + case \* + echo "fisher: Unknown command: \"$cmd\"" >&2 && return 1 + end +end + +## Migrations ## +function _fisher_fish_postexec --on-event fish_postexec + if functions --query _fisher_list + fisher update >/dev/null 2>/dev/null + set --query XDG_DATA_HOME || set --local XDG_DATA_HOME ~/.local/share + test -e $XDG_DATA_HOME/fisher && command rm -rf $XDG_DATA_HOME/fisher + functions --erase _fisher_list _fisher_plugin_parse + set --erase fisher_data + end + functions --erase _fisher_fish_postexec +end diff --git a/fish/functions/fzf_configure_bindings.fish b/fish/functions/fzf_configure_bindings.fish new file mode 100644 index 0000000..12fbf9a --- /dev/null +++ b/fish/functions/fzf_configure_bindings.fish @@ -0,0 +1,44 @@ +# Always installs bindings for insert and default mode for simplicity and b/c it has almost no side-effect +# https://gitter.im/fish-shell/fish-shell?at=60a55915ee77a74d685fa6b1 +function fzf_configure_bindings --description "Installs the default key bindings for fzf.fish with user overrides passed as options." + # no need to install bindings if not in interactive mode or running tests + status is-interactive || test "$CI" = true; or return + + set options_spec h/help 'directory=?' 'git_log=?' 'git_status=?' 'history=?' 'variables=?' + argparse --max-args=0 --ignore-unknown $options_spec -- $argv 2>/dev/null + if test $status -ne 0 + echo "Invalid option or a positional argument was provided." 1>&2 + _fzf_configure_bindings_help + return 22 + else if set --query _flag_help + _fzf_configure_bindings_help + return + else + # Initialize with default key sequences and then override or disable them based on flags + # index 1 = directory, 2 = git_log, 3 = git_status, 4 = history, 5 = variables + set key_sequences \cp \cg \cs \cr \cv # \c = control, \e = escape + set --query _flag_directory && set key_sequences[1] "$_flag_directory" + set --query _flag_git_log && set key_sequences[2] "$_flag_git_log" + set --query _flag_git_status && set key_sequences[3] "$_flag_git_status" + set --query _flag_history && set key_sequences[4] "$_flag_history" + set --query _flag_variables && set key_sequences[5] "$_flag_variables" + + # If fzf bindings already exists, uninstall it first for a clean slate + if functions --query _fzf_uninstall_bindings + _fzf_uninstall_bindings + end + + for mode in default insert + test -n $key_sequences[1] && bind --mode $mode $key_sequences[1] _fzf_search_directory + test -n $key_sequences[2] && bind --mode $mode $key_sequences[2] _fzf_search_git_log + test -n $key_sequences[3] && bind --mode $mode $key_sequences[3] _fzf_search_git_status + test -n $key_sequences[4] && bind --mode $mode $key_sequences[4] _fzf_search_history + test -n $key_sequences[5] && bind --mode $mode $key_sequences[5] "$_fzf_search_vars_command" + end + + function _fzf_uninstall_bindings --inherit-variable key_sequences + bind --erase -- $key_sequences + bind --erase --mode insert -- $key_sequences + end + end +end diff --git a/fish/functions/gbage.fish b/fish/functions/gbage.fish new file mode 100644 index 0000000..d1f107d --- /dev/null +++ b/fish/functions/gbage.fish @@ -0,0 +1,5 @@ +function gbage -d "List local branches and display their age" + git for-each-ref --sort=committerdate refs/heads/ \ + --format="%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))" +end + diff --git a/fish/functions/gbda.fish b/fish/functions/gbda.fish new file mode 100644 index 0000000..d09fe2f --- /dev/null +++ b/fish/functions/gbda.fish @@ -0,0 +1,5 @@ +function gbda -d "Delete all branches merged in current HEAD" + git branch --merged | \ + command grep -vE '^\*|^\s*(master|main|develop)\s*$' | \ + command xargs -n 1 git branch -d +end diff --git a/fish/functions/gcloud_sdk_argcomplete.fish b/fish/functions/gcloud_sdk_argcomplete.fish new file mode 100644 index 0000000..9dea8dd --- /dev/null +++ b/fish/functions/gcloud_sdk_argcomplete.fish @@ -0,0 +1,155 @@ + +function __log --description 'Logs to a file for debugging' +# Uncomment this line to enable debug logging: +# echo -e $argv >> ~/.fspy +end + +function __cut + set -l str $argv[1] + set -l pos $argv[2] + echo (string sub -l $pos -- $str) + echo (string sub -s (math 1+$pos) -- $str) +end + +function __right + set -l str $argv[1] + set -l pos $argv[2] + string sub -s (math 1+$pos) -- $str +end + +function __substr --description 'Classic substr(str, start, end) with 0-based indexing, start inclusive, end exclusive' + set -l str $argv[1] + set -l start (math $argv[2] + 1) + set -l len (math $argv[3] - $argv[2]) + string sub -s $start -l $len -- $str +end + +function __ltrim_ifmatch --description 'Trims arg2 from the left of arg1, if they match, returns 1 otherwise' + set -l ln (string length -- $argv[2]) + set -l left (string sub -l $ln -- $argv[1]) + if test $left = $argv[2] + string sub -s (math $ln + 1) -- $argv[1] + else + return 1 + end +end + +function __ltrim_unsafe --description 'Trims arg2 from the left of arg1, even if they not match' + set -l ln (string length -- $argv[2]) + string sub -s (math $ln + 1) -- $argv[1] +end + +function __rtrim_unsafe --description 'Trims arg2 from the right of arg1, even if they not match' + set -l ln (string length -- $argv[1]) + set -l ln (math $ln - (string length -- $argv[2])) + string sub -l $ln -- $argv[1] +end + +function __rtrim_ifmatch --description 'Trims arg2 from the right of arg1, if they match, returns 1 otherwise' + set -l ln (string length -- $argv[2]) + set -l start (math (string length -- $argv[1]) - $ln + 1) + set -l right (string sub -s $start -- $argv[1]) + if test $right = $argv[2] + string sub -s (math $start - 1) -- $argv[1] + else + return 1 + end +end + +function __call_argcomplete + + __log "Call argcomplete:" $argv + + set -lx input $argv[1] + set -lx COMP_POINT $argv[2] + set -lx tokenStart $argv[3] + set -lx prefix $argv[4] + + set -lx COMP_LINE (string sub -l $tokenStart -- $input) + set -lx words (string split ' ' -- (string sub -l $COMP_POINT -- $input)) + set -lx lastWord $words[-1] + + set -lx _ARGCOMPLETE_COMP_WORDBREAKS \n'"\'@><=;|&(:' + set -lx _ARGCOMPLETE 1 + set -lx CMD $words[1] + + set -l rval (eval $CMD 8>&1 9>&2 1>/dev/null 2>/dev/null) + __log "CloudSDK returned: '$rval'" + if test $status -ne 0 + return + end + + if test ! $rval + if test (count $words) -gt 2 -a -n $lastWord + # Fallback scenario 1: try to ignore the last word if it's not complete: + # Note: this can only happen in the first call on the stack, since we then fallback by words + set -l trimmed (__rtrim_unsafe $input $lastWord) + set -l fallbackPos (string length -- $trimmed) + __call_argcomplete $input $fallbackPos $fallbackPos '' + end + if test (count $words) -gt 3 -a -z $lastWord + # Fallback scenario 2: if last word is blank try fallback to the previous word + set -l prevWordLen (string length -- $words[-2]) + set -l fallbackPos (math $COMP_POINT - $prevWordLen - 1) + __call_argcomplete $input $fallbackPos $tokenStart '' + return + end + end + + set -l options (string split \v -- $rval) + set -l pattern (__substr $input $COMP_POINT $tokenStart) + + for opt in $options + set opt (string replace -r '^(\w+)\\\\://' '$1://' -- $opt) + set -l match (__ltrim_ifmatch $opt $pattern) + if test $status -eq 0 + set -l args (string split -m 1 ' ' -- $match) + if test (count $args) -gt 1 + echo -n "$prefix$args[1]" + echo -n -e "\t" + echo "$args[2]" + else + echo "$prefix$args[1]" + end + end + end +end + +function gcloud_sdk_argcomplete + + __log '$>' (date) + + set -l token (commandline -t) + set -l input (commandline -cp) + set -l fullLine (commandline -p) + set -l cursorAt (string length -- $input) + + set -lx words (string split ' ' -- $input) + + set -lx prefix '' + if string match -q -- '*@*' $words[-1] + if string match -q -- '* ssh *' $input + set -l parts (string split '@' $words[-1]) + set prefix "$parts[1]@" + set words[-1] (string replace -- $prefix '' $words[-1]) + set cursorAt (math $cursorAt - (string length -- $prefix)) + end + end + if string match -q -- '--*=*' $words[-1] + set -l parts (string split '=' -- $words[-1]) + set words[-1] (string join ' ' -- $parts) + set prefix "$parts[1]=" + end + set input (string join ' ' -- $words) + # well, this is a bit strage, but seemingly 8 \-s will actually print 1 \, a bit of escaping hell + set -l escaped (string replace -a -r '(\s\w+)://' '${1}\\\\\\\\://' -- $input) + set -l ilen (string length -- $input) + set -l elen (string length -- $escaped) + if test $elen -gt $ilen + set input $escaped + set cursorAt (math $cursorAt - $ilen + $elen) + end + + __call_argcomplete $input $cursorAt $cursorAt $prefix + +end diff --git a/fish/functions/gdt.fish b/fish/functions/gdt.fish new file mode 100644 index 0000000..f1dee9b --- /dev/null +++ b/fish/functions/gdt.fish @@ -0,0 +1,3 @@ +function gdt -w "git diff" -d "List changed files" + git diff-tree --no-commit-id --name-only -r $argv +end diff --git a/fish/functions/gdv.fish b/fish/functions/gdv.fish new file mode 100644 index 0000000..cb648fe --- /dev/null +++ b/fish/functions/gdv.fish @@ -0,0 +1,3 @@ +function gdv -w "git diff -w" -d "Pipe `git diff` to `view` command" + git diff -w $argv | view - +end diff --git a/fish/functions/ggl.fish b/fish/functions/ggl.fish new file mode 100644 index 0000000..a748185 --- /dev/null +++ b/fish/functions/ggl.fish @@ -0,0 +1,3 @@ +function ggl -w "git pull origin master" -d "git pull origin " + git pull origin (__git.current_branch) $argv +end diff --git a/fish/functions/ggp.fish b/fish/functions/ggp.fish new file mode 100644 index 0000000..bf09636 --- /dev/null +++ b/fish/functions/ggp.fish @@ -0,0 +1,3 @@ +function ggp -w "git push origin master" -d "git push origin " + git push origin (__git.current_branch) $argv +end diff --git a/fish/functions/ggpnp.fish b/fish/functions/ggpnp.fish new file mode 100644 index 0000000..710abab --- /dev/null +++ b/fish/functions/ggpnp.fish @@ -0,0 +1,5 @@ +function ggpnp -d "git pull & push origin " + set -l current_branch (__git.current_branch) + and git pull origin $current_branch + and git push origin $current_branch +end diff --git a/fish/functions/ggsup.fish b/fish/functions/ggsup.fish new file mode 100644 index 0000000..4db2038 --- /dev/null +++ b/fish/functions/ggsup.fish @@ -0,0 +1,3 @@ +function ggsup -d "git set upstream to origin/" + git branch --set-upstream-to=origin/(__git.current_branch) +end diff --git a/fish/functions/ggu.fish b/fish/functions/ggu.fish new file mode 100644 index 0000000..5c1f208 --- /dev/null +++ b/fish/functions/ggu.fish @@ -0,0 +1,3 @@ +function ggu -d "Rebase the current branch on top of the upstream branch after fetching" + git pull --rebase origin (__git.current_branch) +end diff --git a/fish/functions/gignored.fish b/fish/functions/gignored.fish new file mode 100644 index 0000000..622b223 --- /dev/null +++ b/fish/functions/gignored.fish @@ -0,0 +1,3 @@ +function gignored -w 'grep "^[[:lower:]]"' -d "list temporarily ignored files" + git ls-files -v | grep "^[[:lower:]]" $argv +end diff --git a/fish/functions/glp.fish b/fish/functions/glp.fish new file mode 100644 index 0000000..6b55085 --- /dev/null +++ b/fish/functions/glp.fish @@ -0,0 +1,5 @@ +function glp -d "git log at requested pretty level" -a format + set -q format[1]; and git log --pretty=$format +end + +complete -c glp -x -a "(complete -C 'git log --pretty=' | sed 's/^--pretty=//')" diff --git a/fish/functions/gpoat.fish b/fish/functions/gpoat.fish new file mode 100644 index 0000000..1254c10 --- /dev/null +++ b/fish/functions/gpoat.fish @@ -0,0 +1,3 @@ +function gpoat -d "git push all + tags to origin" + git push origin --all; and git push origin --tags +end diff --git a/fish/functions/grename.fish b/fish/functions/grename.fish new file mode 100644 index 0000000..90531a5 --- /dev/null +++ b/fish/functions/grename.fish @@ -0,0 +1,11 @@ +function grename -d "Rename 'old' branch to 'new', including in origin remote" -a old new + if test (count $argv) -ne 2 + echo "Usage: "(status -u)" old_branch new_branch" + return 1 + end + git branch -m $old $new + git push origin :$old + and git push --set-upstream origin $new +end + +complete -c grename -x -a "(complete -C 'git branch ')" diff --git a/fish/functions/grt.fish b/fish/functions/grt.fish new file mode 100644 index 0000000..f70e0d0 --- /dev/null +++ b/fish/functions/grt.fish @@ -0,0 +1,3 @@ +function grt -d "cd into the top of the current repository or submodule" + cd (git rev-parse --show-toplevel; or echo ".") +end diff --git a/fish/functions/gtl.fish b/fish/functions/gtl.fish new file mode 100644 index 0000000..5ff8ae2 --- /dev/null +++ b/fish/functions/gtl.fish @@ -0,0 +1,3 @@ +function gtl -d "List tags matching prefix" -a prefix + git tag --sort=-v:refname -n -l $prefix\* +end diff --git a/fish/functions/gunwip.fish b/fish/functions/gunwip.fish new file mode 100644 index 0000000..91777e8 --- /dev/null +++ b/fish/functions/gunwip.fish @@ -0,0 +1,7 @@ +# Work In Progress (wip) +# These features allow to pause a branch development and switch to another one +# When you want to go back to work, just unwip it +# +function gunwip -d "git uncommit the work-in-progress branch" + git log -n 1 | grep -q -c "\-\-wip\-\-"; and git reset HEAD~1 +end diff --git a/fish/functions/gwip.fish b/fish/functions/gwip.fish new file mode 100644 index 0000000..2d41368 --- /dev/null +++ b/fish/functions/gwip.fish @@ -0,0 +1,7 @@ +# Work In Progress (wip) +# These features allow to pause a branch development and switch to another one +# When you want to go back to work, just unwip it +# +function gwip -d "git commit a work-in-progress branch" + git add -A; git rm (git ls-files --deleted) 2> /dev/null; git commit -m "--wip--" +end diff --git a/fish/functions/is_status_ok.fish b/fish/functions/is_status_ok.fish new file mode 100644 index 0000000..2a95697 --- /dev/null +++ b/fish/functions/is_status_ok.fish @@ -0,0 +1,3 @@ +function is_status_okay + [ $status = 0 ] +end diff --git a/fish/functions/iterm2_print_user_vars.fish b/fish/functions/iterm2_print_user_vars.fish new file mode 100644 index 0000000..7785493 --- /dev/null +++ b/fish/functions/iterm2_print_user_vars.fish @@ -0,0 +1,3 @@ +function iterm2_print_user_vars + iterm2_set_user_var kubecontext "☸️"(kubectl config current-context) +end diff --git a/fish/functions/rmrf.fish b/fish/functions/rmrf.fish new file mode 100644 index 0000000..a8b8837 --- /dev/null +++ b/fish/functions/rmrf.fish @@ -0,0 +1,3 @@ +function rmrf --wraps='rm -rfi' --description 'alias rmrf=rm -rfi' + rm -rfi $argv; +end diff --git a/fish/functions/ssh_agent.fish b/fish/functions/ssh_agent.fish new file mode 100644 index 0000000..8f97a3d --- /dev/null +++ b/fish/functions/ssh_agent.fish @@ -0,0 +1,7 @@ +function ssh_agent +if test -z (pgrep ssh-agent | string collect) +eval (ssh-agent -c) +set -Ux SSH_AUTH_SOCK $SSH_AUTH_SOCK +set -Ux SSH_AGENT_PID $SSH_AGENT_PID +end +end diff --git a/init.vim b/init.vim new file mode 100644 index 0000000..57601ea --- /dev/null +++ b/init.vim @@ -0,0 +1,218 @@ +set number +set relativenumber +set autoindent + +" coc.nvim Setup +set cmdheight=2 +set updatetime=1000 + +" don't use arrowkeys +noremap +noremap +noremap +noremap + +" really, just don't +inoremap +inoremap +inoremap +inoremap + +call plug#begin("~/.vim/plugged") +Plug 'scrooloose/nerdtree' +Plug 'Xuyuanp/nerdtree-git-plugin' +Plug 'neoclide/coc.nvim', {'branch': 'release'} + +Plug 'airblade/vim-gitgutter' " Show git diff of lines edited +Plug 'tpope/vim-fugitive' " :Gblame +Plug 'tpope/vim-rhubarb' " :GBrowse +Plug 'vim-airline/vim-airline' +Plug 'vim-airline/vim-airline-themes' +Plug 'edkolev/tmuxline.vim' " vim-airline compatible tmux bar + +Plug 'tpope/vim-endwise' " Autocomplete end after a do +Plug 'mileszs/ack.vim' " Use ack in Vim + +Plug 'pangloss/vim-javascript' " JavaScript support +Plug 'leafgarland/typescript-vim' " TypeScript syntax +Plug 'peitalin/vim-jsx-typescript' +Plug 'maxmellon/vim-jsx-pretty' " JS and JSX syntax +Plug 'jparise/vim-graphql' " GraphQL syntax +Plug 'styled-components/vim-styled-components' + +Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --bin' } +Plug 'junegunn/fzf.vim' + +Plug 'Yggdroot/indentLine' " Indentation Lines + +Plug 'APZelos/blamer.nvim' " Git Blame + +Plug 'dracula/vim' + +Plug 'voldikss/vim-floaterm' " Floaterm + +Plug 'ryanoasis/vim-devicons' " Keep this last always +call plug#end() +autocmd BufEnter *.{js,jsx,ts,tsx,py} :syntax sync fromstart +autocmd BufLeave *.{js,jsx,ts,tsx,py} :syntax sync clear + +if (has("termguicolors")) + set termguicolors +endif +syntax enable +colorscheme dracula + +" NERDTree on ctrl+n +let NERDTreeShowHidden=1 +nnoremap n :NERDTreeFocus +nnoremap :NERDTree +nnoremap :NERDTreeToggle +nnoremap :NERDTreeFind +map j +map k +map h +map l + +" NERDTree config +let g:NERDTreeWinPos = 1 " open on right +let g:NERDTreeWinSize = 45 +let g:NERDTreeShowHidden = 1 +let g:NERDTreeMinimalUI = 1 +let g:NERDTreeDirArrows = 1 +let g:NERDTreeIgnore = [] +let g:NERDTreeStatusline = '' +autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif + +" Integrated Terminal +" open new split panes to right and below +set splitright +set splitbelow +" turn terminal to normal mode with escape +" tnoremap +" start terminal in insert mode +au BufEnter * if &buftype == 'terminal' | :startinsert | endif +" open terminal on ctrl+n +"function! OpenTerminal() +" split term://fish +" resize 10 +"endfunction +"nnoremap :call OpenTerminal() +nnoremap :FloatermToggle +let g:floaterm_wintype = 'split' + +" FZF Mapping +let g:fzf_action = { + \ 'ctrl-t': 'tab split', + \ 'ctrl-s': 'split', + \ 'ctrl-v': 'vsplit' + \} +let $FZF_DEFAULT_COMMAND = 'ag -g ""' + +" COC namp +"" Remap keys for applying codeAction to the current line. +nmap ac (coc-codeaction) + +"" Apply AutoFix to problem on the current line. +nmap qf (coc-fix-current) + +"" Rename +nmap rn (coc-rename) + +"" GoTo code navigation. +nmap gd (coc-definition) +nmap gD :vsplit(coc-definition) +nmap gy (coc-type-definition) +nmap gY :vsplit(coc-type-definition) +nmap gi (coc-implementation) +nmap gI :vsplit(coc-implementation) +nmap gr (coc-references) + +nmap [g (coc-diagnostic-prev) +nmap ]g (coc-diagnostic-next) + +nnoremap d :CocList diagnostics +nnoremap s :CocList -I symbols + +inoremap + \ pumvisible() ? "\" : + \ check_back_space() ? "\" : + \ coc#refresh() +inoremap coc#pum#visible() ? coc#pum#confirm() +inoremap pumvisible() ? "\" : "\" +function! s:check_back_space() abort + let col = col('.') - 1 + return !col || getline('.')[col - 1] =~# '\s' +endfunction + +inoremap coc#refresh() +nnoremap K :call show_documentation() + +function! s:show_documentation() + if (index(['vim','help'], &filetype) >= 0) + execute 'h '.expand('') + elseif (coc#rpc#ready()) + call CocActionAsync('doHover') + else + execute '!' . &keywordprg . " " . expand('') + endif +endfunction + +function! ShowDocIfNoDiagnostic(timer_id) + if (coc#float#has_float() == 0 && CocHasProvider('hover') == 1) + silent call CocActionAsync('doHover') + endif +endfunction + +function! s:show_hover_doc() + call timer_start(200, 'ShowDocIfNoDiagnostic') +endfunction + +autocmd CursorHoldI * :call show_hover_doc() +autocmd CursorHold * :call show_hover_doc() + +" Diagnostics color +hi! CocErrorSign guifg=#d1666a +hi! CocInfoSign guibg=#353b45 +hi! CocWarningSign guifg=#d1cd66 + +" make FZF respect gitignore if `ag` is installed +" you will obviously need to install `ag` for this to work +if (executable('ag')) + let $FZF_DEFAULT_COMMAND = 'ag --hidden --ignore .git -g ""' +endif + +nnoremap :Files + +" VimWiki settings +set nocompatible +filetype plugin on +syntax on + + + " VimWiki let +let g:vimwiki_list = [{'path': '~/Nextcloud/vimwiki/', 'ext': '.md'}] + +" COC let +let g:coc_global_extensions = [ 'coc-tsserver' ] + +" ESLint & Prettier +if isdirectory('./node_modules') && isdirectory('./node_modules/prettier') + let g:coc_global_extensions += ['coc-prettier'] +endif + +if isdirectory('./node_modules') && isdirectory('./node_modules/eslint') + let g:coc_global_extensions += ['coc-eslint'] +endif + +let g:typescript_indent_disable = 1 + +" YAML config +autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab +autocmd FileType ts setlocal ts=2 sts=2 sw=2 expandtab +autocmd FileType js setlocal ts=2 sts=2 sw=2 expandtab +autocmd FileType tf setlocal ts=2 sts=2 sw=2 expandtab +let g:indentLine_char = '⦙' + +" Increase win size +nnoremap = :exe "resize " . (winheight(0) * 3/2) +nnoremap - :exe "resize " . (winheight(0) * 2/3)