complete-c$program-f-l no-$color-d"Disable all colored output"
end
end
set-lsalt_programs_output salt salt-call salt-key
forprogramin$salt_programs_output
foroutin out output
complete-c$program-x-l$out-d"Print the output from the \"$program\" command using the specified outputter"-a"raw compact no_return grains overstatestage pprint json nested yaml highstate quiet key txt virt_query newline_values_only"
complete-c$program-r-l$out-file -d"Write the output to the specified file"
complete-c$program-x-l$out-file-append -d"Append the output to the specified file"
complete-c$program-x-l$out-indent -d"Print the output indented by the provided value in spaces. Negative values disables indentation. Only applicable in outputters that support indentation."
end
end
set-lsalt_programs_doc salt salt-call salt-run
forprogramin$salt_programs_doc
fordocin doc documentation
complete-c$program-f-s d -l$doc-d"Display documentation for runners, pass a runner or runner.function to see documentation on only that runner or function."
end
end
set-lsalt_programs_select salt salt-cp
forprogramin$salt_programs_select
complete-c$program-f-s G -l grain -d"Instead of using shell globs to evaluate the target use a grain value to identify targets, the syntax for the target is the grain key followed by a globexpression: \"os:Arch*\""
complete-c$program-f-l grain-pcre -d"Instead of using shell globs to evaluate the target use a grain value to identify targets, the syntax for the target is the grain key followed by a pcre regular expression: \"os:Arch.*\""
complete-c$program-f-s L -l list -d"Instead of using shell globs to evaluate the target servers, take a comma or whitespace delimited list of servers."
complete-c$program-f-s N -l nodegroup -d"Instead of using shell globs to evaluate the target use one of the predefined nodegroups to identify a list of targets."
complete-c$program-f-s E -l pcre -d"Instead of using shell globs to evaluate the target servers, use pcre regular expressions"
complete-c$program-f-s R -l range -d"Instead of using shell globs to evaluate the target use a range expression to identify targets. Range expressions look like %cluster"
end
set-lsalt_programs_user_daemon_pidfile\
salt-master salt-minion salt-syndic
forprogramin$salt_programs_user_daemon_pidfile
complete-c$program-x-s u -l user -d"Specify user to run $program"
complete-c$program-f-s d -l daemon -d"Run the $program as a daemon"
complete-c$program-l pid-file -d"Specify the location of the pidfile. Default: /var/run/$program.pid."
end
function__fish_salt_default_timeout
echo(echo$argv[1]|sed '
s/^salt$/5/g;
s/^salt-call$/60/g;
s/^salt-cp$/5/g;
s/^salt-run$/1/g
')
end
set-lsalt_programs_timeout salt salt-call salt-cp \
salt-run
forprogramin$salt_programs_timeout
complete-c$program-x-s t -l timeout -d"Change the timeout, if applicable, for the running command; default="(__fish_salt_default_timeout$program)
end
set-lsalt_programs_return salt salt-cp
forprogramin$salt_programs_return
complete-c$program-x-l return -d"Set an alternative return method. By default salt will send the return data from the command back to the master, but the return data can be redirected into any number of systems, databases or applications."
end
# convinience functions
function__fish_salt_log
echo$argv>&2
end
function__fish_salt_join
# remove empty elements
seta(echo$argv[2..-1]|sed's/ /\n/g'|grep-Ev'^$')
setdelimiter$argv[1]
printf"$delimiter%s"$a|cut-c2-
end
function__fish_salt_clean_prefix
setprefix'^'$argv[1]
grep -E$prefix|sed"s/$prefix//g"
end
function__fish_salt_clean
if[$argv[1]= yaml ]
__fish_salt_clean_prefix ' *- '
elseif[$argv[1]= nested ]
__fish_salt_clean_prefix ' *'
end
end
set-g__fish_salt_max_line_count_in_yaml_block1024
function__fish_salt_lines_between
setmax$__fish_salt_max_line_count_in_yaml_block
grep -A$max$argv[1]|grep-B$max$argv[2]
end
function__fish_salt_extract_first_yaml_block
setmax$__fish_salt_max_line_count_in_yaml_block
sed '1d'|sed'$a\ stop'|grep-m1-B$max'^ \w'|sed'$d'
end
function__fish_salt_add_help
sed "s/\$/\t$argv/"
end
function__fish_salt_underscore_to_space
sed 's/^\w/\u&/g; s/_/ /g'
end
# information extraction from commandline
set-g__fish_salt_default_program'salt'
# BUG: Completion doesn't work with correct commandline like
# salt --out raw server test.ping
# Consider rewriting using __fish_complete_subcommand