Restyle codebase

Not a lot of changes, tbh
This commit is contained in:
Fabian Boehm 2022-06-16 18:43:28 +02:00
parent 18433278ec
commit 8f08fe80fd
21 changed files with 176 additions and 144 deletions

View File

@ -131,11 +131,11 @@ html_sidebars = {"**": ["globaltoc.html", "searchbox.html", "localtoc.html"]}
# The default font is "GNU FreeSans" or something which I've never heard of.
# Make this something that might actually be installed.
latex_elements = {
'fontpkg': r'''
"fontpkg": r"""
\setmainfont{Noto Serif}
\setsansfont{Noto Sans}
\setmonofont{Noto Sans Mono}
''',
""",
}
# Grouping the document tree into LaTeX files. List of tuples
@ -153,23 +153,24 @@ latex_documents = [
# The default pdflatex doesn't handle unicode.
# Switch to an engine that does (why pdflatex still exists and is still the default? I don't know)
latex_engine = 'xelatex'
latex_engine = "xelatex"
# -- Options for manual page output ------------------------------------------
def get_command_description(path, name):
""" Return the description for a command, by parsing its synopsis line """
"""Return the description for a command, by parsing its synopsis line"""
with open(path) as opened:
for line in opened:
if line.startswith(name + ' - '):
_, desc = line.split(' - ', 1)
if line.startswith(name + " - "):
_, desc = line.split(" - ", 1)
return desc.strip()
elif line.startswith('``' + name + '`` - '):
_, desc = line.split('`` - ', 1)
return desc.strip('`')
elif line.startswith("``" + name + "`` - "):
_, desc = line.split("`` - ", 1)
return desc.strip("`")
raise SphinxWarning("No description in file %s" % os.path.basename(path))
# Newer sphinxen apparently create another subdirectory which breaks our man lookup.
# Unbreak it (#7996)
man_make_section_directory = False
@ -236,6 +237,6 @@ epub_exclude_files = ["search.html"]
# Enable smart-quotes
# default action is 'qDe': quotes, Dashes, ellipsis. Skip dashes for --options
smartquotes = True
smartquotes_action = 'qe'
smartquotes_action = "qe"
linkcheck_ignore = [r'https://github.com/fish-shell/fish-shell/issues/\d+']
linkcheck_ignore = [r"https://github.com/fish-shell/fish-shell/issues/\d+"]

View File

@ -28,7 +28,7 @@ complete -n "not __fish_seen_subcommand_from $commands" -c fastboot -l set-activ
complete -f -n "not __fish_seen_subcommand_from $commands" -c fastboot -a flashall -d 'Flash all partitions from $ANDROID_PRODUCT_OUT'
complete -f -n "not __fish_seen_subcommand_from $commands" -c fastboot -a getvar -d 'Display given bootloader variable'
complete -f -n "not __fish_seen_subcommand_from $commands" -c fastboot -a oem -d 'Execute OEM-specific command'
complete -f -n "not __fish_seen_subcommand_from $commands" -c fastboot -a flashing -d 'Lock/unlock'
complete -f -n "not __fish_seen_subcommand_from $commands" -c fastboot -a flashing -d Lock/unlock
complete -f -n "not __fish_seen_subcommand_from $commands" -c fastboot -a reboot -d 'Reboot device'
complete -f -n "not __fish_seen_subcommand_from $commands" -c fastboot -a update -d 'Flash all partitions from an update.zip package'
complete -f -n "not __fish_seen_subcommand_from $commands" -c fastboot -a erase -d 'Erase a flash partition'

View File

@ -909,7 +909,7 @@ complete -f -c git -n '__fish_git_using_command fetch pull' -l set-upstream -d '
complete -f -c git -n __fish_git_needs_command -a fetch -d 'Download objects and refs from another repository'
# Suggest "repository", then "refspec" - this also applies to e.g. push/pull
complete -f -c git -n '__fish_git_using_command fetch' -n 'not __fish_git_branch_for_remote' -a '(__fish_git_remotes)' -d Remote
complete -f -c git -n '__fish_git_using_command fetch' -n '__fish_git_branch_for_remote' -a '(__fish_git_branch_for_remote)'
complete -f -c git -n '__fish_git_using_command fetch' -n __fish_git_branch_for_remote -a '(__fish_git_branch_for_remote)'
complete -f -c git -n '__fish_git_using_command fetch' -s q -l quiet -d 'Be more quiet'
complete -f -c git -n '__fish_git_using_command fetch' -s v -l verbose -d 'Be more verbose'
complete -f -c git -n '__fish_git_using_command fetch' -s a -l append -d 'Append to .git/FETCH_HEAD instead of overwriting'
@ -991,7 +991,7 @@ complete -f -c git -n __fish_git_needs_command -a show -d 'Shows the last commit
complete -f -c git -n '__fish_git_using_command show' -n 'not contains -- -- (commandline -opc)' -a '(__fish_git_branches)'
complete -f -c git -n '__fish_git_using_command show' -n 'not contains -- -- (commandline -opc)' -ka '(__fish_git_tags)' -d Tag
complete -f -c git -n '__fish_git_using_command show' -n 'not contains -- -- (commandline -opc)' -ka '(__fish_git_commits)'
complete -f -c git -n '__fish_git_needs_rev_files' -n 'not contains -- -- (commandline -opc)' -xa '(__fish_git_complete_rev_files)'
complete -f -c git -n __fish_git_needs_rev_files -n 'not contains -- -- (commandline -opc)' -xa '(__fish_git_complete_rev_files)'
complete -F -c git -n '__fish_git_using_command show' -n 'contains -- -- (commandline -opc)'
complete -f -c git -n '__fish_git_using_command show' -l format -d 'Pretty-print the contents of the commit logs in a given format' -a '(__fish_git_show_opt format)'
complete -f -c git -n '__fish_git_using_command show' -l abbrev-commit -d 'Show only a partial hexadecimal commit object name'
@ -1192,7 +1192,7 @@ complete -f -c git -n '__fish_git_using_command cherry' -k -a '(__fish_git_refs)
complete -f -c git -n __fish_git_needs_command -a cherry-pick -d 'Apply the change introduced by an existing commit'
complete -f -c git -n '__fish_git_using_command cherry-pick' -k -a '(__fish_git_ranges)'
# TODO: Filter further
complete -f -c git -n '__fish_git_using_command cherry-pick' -n '__fish_git_possible_commithash' -ka '(__fish_git_commits)'
complete -f -c git -n '__fish_git_using_command cherry-pick' -n __fish_git_possible_commithash -ka '(__fish_git_commits)'
complete -f -c git -n '__fish_git_using_command cherry-pick' -s e -l edit -d 'Edit the commit message prior to committing'
complete -f -c git -n '__fish_git_using_command cherry-pick' -s x -d 'Append info in generated commit on the origin of the cherry-picked change'
complete -f -c git -n '__fish_git_using_command cherry-pick' -s n -l no-commit -d 'Apply changes without making any commit'
@ -1742,7 +1742,7 @@ complete -f -c git -n '__fish_git_using_command pull' -s p -l prune -d 'Remove r
# TODO --upload-pack
complete -f -c git -n '__fish_git_using_command pull' -l progress -d 'Force progress status'
complete -f -c git -n '__fish_git_using_command pull' -n 'not __fish_git_branch_for_remote' -a '(__fish_git_remotes)' -d 'Remote alias'
complete -f -c git -n '__fish_git_using_command pull' -n '__fish_git_branch_for_remote' -a '(__fish_git_branch_for_remote)'
complete -f -c git -n '__fish_git_using_command pull' -n __fish_git_branch_for_remote -a '(__fish_git_branch_for_remote)'
# Options related to merging
complete -f -c git -n '__fish_git_using_command pull' -l commit -d "Autocommit the merge"
complete -f -c git -n '__fish_git_using_command pull' -l no-commit -d "Don't autocommit the merge"
@ -1781,16 +1781,16 @@ complete -f -c git -n '__fish_git_using_command range-diff' -l no-dual-color -d
### push
complete -f -c git -n __fish_git_needs_command -a push -d 'Update remote refs along with associated objects'
complete -f -c git -n '__fish_git_using_command push' -n 'not __fish_git_branch_for_remote' -a '(__fish_git_remotes)' -d 'Remote alias'
complete -f -c git -n '__fish_git_using_command push' -n '__fish_git_branch_for_remote' -ka '(__fish_git_tags)' -d Tag
complete -f -c git -n '__fish_git_using_command push' -n '__fish_git_branch_for_remote' -ka '(__fish_git_branches)'
complete -f -c git -n '__fish_git_using_command push' -n '__fish_git_branch_for_remote' -ka '(__fish_git_heads)'
complete -f -c git -n '__fish_git_using_command push' -n __fish_git_branch_for_remote -ka '(__fish_git_tags)' -d Tag
complete -f -c git -n '__fish_git_using_command push' -n __fish_git_branch_for_remote -ka '(__fish_git_branches)'
complete -f -c git -n '__fish_git_using_command push' -n __fish_git_branch_for_remote -ka '(__fish_git_heads)'
# The "refspec" here is an optional "+" to signify a force-push
complete -f -c git -n '__fish_git_using_command push' -n '__fish_git_branch_for_remote' -n 'string match -q "+*" -- (commandline -ct)' -a '+(__fish_git_branches | string replace -r \t".*" "")' -d 'Force-push branch'
complete -f -c git -n '__fish_git_using_command push' -n __fish_git_branch_for_remote -n 'string match -q "+*" -- (commandline -ct)' -a '+(__fish_git_branches | string replace -r \t".*" "")' -d 'Force-push branch'
# git push REMOTE :BRANCH deletes BRANCH on remote REMOTE
complete -f -c git -n '__fish_git_using_command push' -n '__fish_git_branch_for_remote' -n 'string match -q ":*" -- (commandline -ct)' -a ':(__fish_git_branch_for_remote | string replace -r \t".*" "")' -d 'Delete remote branch'
complete -f -c git -n '__fish_git_using_command push' -n __fish_git_branch_for_remote -n 'string match -q ":*" -- (commandline -ct)' -a ':(__fish_git_branch_for_remote | string replace -r \t".*" "")' -d 'Delete remote branch'
# then src:dest (where both src and dest are git objects, so we want to complete branches)
complete -f -c git -n '__fish_git_using_command push' -n '__fish_git_branch_for_remote' -n 'string match -q "+*:*" -- (commandline -ct)' -a '(commandline -ct | string replace -r ":.*" ""):(__fish_git_branch_for_remote | string replace -r \t".*" "")' -d 'Force-push local branch to remote branch'
complete -f -c git -n '__fish_git_using_command push' -n '__fish_git_branch_for_remote' -n 'string match -q "*:*" -- (commandline -ct)' -a '(commandline -ct | string replace -r ":.*" ""):(__fish_git_branch_for_remote | string replace -r \t".*" "")' -d 'Push local branch to remote branch'
complete -f -c git -n '__fish_git_using_command push' -n __fish_git_branch_for_remote -n 'string match -q "+*:*" -- (commandline -ct)' -a '(commandline -ct | string replace -r ":.*" ""):(__fish_git_branch_for_remote | string replace -r \t".*" "")' -d 'Force-push local branch to remote branch'
complete -f -c git -n '__fish_git_using_command push' -n __fish_git_branch_for_remote -n 'string match -q "*:*" -- (commandline -ct)' -a '(commandline -ct | string replace -r ":.*" ""):(__fish_git_branch_for_remote | string replace -r \t".*" "")' -d 'Push local branch to remote branch'
complete -f -c git -n '__fish_git_using_command push' -l all -d 'Push all refs under refs/heads/'
complete -f -c git -n '__fish_git_using_command push' -l prune -d "Remove remote branches that don't have a local counterpart"
complete -f -c git -n '__fish_git_using_command push' -l mirror -d 'Push all refs under refs/'
@ -1814,11 +1814,11 @@ complete -f -c git -n '__fish_git_using_command rebase' -a '(__fish_git_branches
complete -f -c git -n '__fish_git_using_command rebase' -a '(__fish_git_heads)' -d Head
complete -f -c git -n '__fish_git_using_command rebase' -a '(__fish_git_tags)' -d Tag -k
complete -f -c git -n '__fish_git_using_command rebase' -a '(__fish_git_recent_commits)' -k
complete -f -c git -n '__fish_git_using_command rebase' -n '__fish_git_is_rebasing' -l continue -d 'Restart the rebasing process'
complete -f -c git -n '__fish_git_using_command rebase' -n '__fish_git_is_rebasing' -l abort -d 'Abort the rebase operation'
complete -f -c git -n '__fish_git_using_command rebase' -n '__fish_git_is_rebasing' -l edit-todo -d 'Edit the todo list'
complete -f -c git -n '__fish_git_using_command rebase' -n __fish_git_is_rebasing -l continue -d 'Restart the rebasing process'
complete -f -c git -n '__fish_git_using_command rebase' -n __fish_git_is_rebasing -l abort -d 'Abort the rebase operation'
complete -f -c git -n '__fish_git_using_command rebase' -n __fish_git_is_rebasing -l edit-todo -d 'Edit the todo list'
complete -f -c git -n '__fish_git_using_command rebase' -l keep-empty -d "Keep the commits that don't change anything"
complete -f -c git -n '__fish_git_using_command rebase' -n '__fish_git_is_rebasing' -l skip -d 'Restart the rebasing process by skipping the current patch'
complete -f -c git -n '__fish_git_using_command rebase' -n __fish_git_is_rebasing -l skip -d 'Restart the rebasing process by skipping the current patch'
complete -f -c git -n '__fish_git_using_command rebase' -s m -l merge -d 'Use merging strategies to rebase'
complete -f -c git -n '__fish_git_using_command rebase' -s q -l quiet -d 'Be quiet'
complete -f -c git -n '__fish_git_using_command rebase' -s v -l verbose -d 'Be verbose'
@ -2012,16 +2012,16 @@ complete -f -c git -n '__fish_git_using_command worktree' -n '__fish_seen_subcom
### stash
complete -c git -n __fish_git_needs_command -a stash -d 'Stash away changes'
complete -f -c git -n '__fish_git_using_command stash' -n '__fish_git_stash_not_using_subcommand' -a list -d 'List stashes'
complete -f -c git -n '__fish_git_using_command stash' -n '__fish_git_stash_not_using_subcommand' -a show -d 'Show the changes recorded in the stash'
complete -f -c git -n '__fish_git_using_command stash' -n '__fish_git_stash_not_using_subcommand' -a pop -d 'Apply and remove a single stashed state'
complete -f -c git -n '__fish_git_using_command stash' -n '__fish_git_stash_not_using_subcommand' -a apply -d 'Apply a single stashed state'
complete -f -c git -n '__fish_git_using_command stash' -n '__fish_git_stash_not_using_subcommand' -a clear -d 'Remove all stashed states'
complete -f -c git -n '__fish_git_using_command stash' -n '__fish_git_stash_not_using_subcommand' -a drop -d 'Remove a single stashed state from the stash list'
complete -f -c git -n '__fish_git_using_command stash' -n '__fish_git_stash_not_using_subcommand' -a create -d 'Create a stash'
complete -f -c git -n '__fish_git_using_command stash' -n '__fish_git_stash_not_using_subcommand' -a save -d 'Save a new stash'
complete -f -c git -n '__fish_git_using_command stash' -n '__fish_git_stash_not_using_subcommand' -a branch -d 'Create a new branch from a stash'
complete -f -c git -n '__fish_git_using_command stash' -n '__fish_git_stash_not_using_subcommand' -a push -d 'Create a new stash with given files'
complete -f -c git -n '__fish_git_using_command stash' -n __fish_git_stash_not_using_subcommand -a list -d 'List stashes'
complete -f -c git -n '__fish_git_using_command stash' -n __fish_git_stash_not_using_subcommand -a show -d 'Show the changes recorded in the stash'
complete -f -c git -n '__fish_git_using_command stash' -n __fish_git_stash_not_using_subcommand -a pop -d 'Apply and remove a single stashed state'
complete -f -c git -n '__fish_git_using_command stash' -n __fish_git_stash_not_using_subcommand -a apply -d 'Apply a single stashed state'
complete -f -c git -n '__fish_git_using_command stash' -n __fish_git_stash_not_using_subcommand -a clear -d 'Remove all stashed states'
complete -f -c git -n '__fish_git_using_command stash' -n __fish_git_stash_not_using_subcommand -a drop -d 'Remove a single stashed state from the stash list'
complete -f -c git -n '__fish_git_using_command stash' -n __fish_git_stash_not_using_subcommand -a create -d 'Create a stash'
complete -f -c git -n '__fish_git_using_command stash' -n __fish_git_stash_not_using_subcommand -a save -d 'Save a new stash'
complete -f -c git -n '__fish_git_using_command stash' -n __fish_git_stash_not_using_subcommand -a branch -d 'Create a new branch from a stash'
complete -f -c git -n '__fish_git_using_command stash' -n __fish_git_stash_not_using_subcommand -a push -d 'Create a new stash with given files'
complete -f -c git -n '__fish_git_stash_using_command apply' -a '(__fish_git_complete_stashes)'
complete -f -c git -n '__fish_git_stash_using_command branch' -a '(__fish_git_complete_stashes)'

View File

@ -1,23 +1,23 @@
# Fish completion for gnome-extensions
function __fish_gnome-extensions_complete_all_extensions
gnome-extensions list
gnome-extensions list
end
function __fish_gnome-extensions_complete_enabled_extensions
gnome-extensions list --enabled
gnome-extensions list --enabled
end
function __fish_gnome-extensions_complete_disabled_extensions
gnome-extensions list --disabled
gnome-extensions list --disabled
end
function __fish_gnome-extensions_complete_enabled_extensions_with_preferences
gnome-extensions list --enabled --prefs | sort
gnome-extensions list --enabled --prefs | sort
end
function __fish_gnome-extensions_complete_disabled_extensions_with_preferences
gnome-extensions list --disabled --prefs | sort
gnome-extensions list --disabled --prefs | sort
end
set -l commands_with_quiet enable disable reset uninstall list info show prefs create pack install
@ -26,18 +26,18 @@ set -l commands_without_help version $commands_with_quiet
complete -f -c gnome-extensions
complete -c gnome-extensions -n "not __fish_seen_subcommand_from $commands" -a "help" -d "Print help"
complete -c gnome-extensions -n "not __fish_seen_subcommand_from $commands" -a "version" -d "Print version"
complete -c gnome-extensions -n "not __fish_seen_subcommand_from $commands" -a "enable" -d "Enable extension"
complete -c gnome-extensions -n "not __fish_seen_subcommand_from $commands" -a "disable" -d "Disable extension"
complete -c gnome-extensions -n "not __fish_seen_subcommand_from $commands" -a "reset" -d "Reset extension"
complete -c gnome-extensions -n "not __fish_seen_subcommand_from $commands" -a "uninstall" -d "Uninstall extension"
complete -c gnome-extensions -n "not __fish_seen_subcommand_from $commands" -a "list" -d "List extensions"
complete -c gnome-extensions -n "not __fish_seen_subcommand_from $commands" -a help -d "Print help"
complete -c gnome-extensions -n "not __fish_seen_subcommand_from $commands" -a version -d "Print version"
complete -c gnome-extensions -n "not __fish_seen_subcommand_from $commands" -a enable -d "Enable extension"
complete -c gnome-extensions -n "not __fish_seen_subcommand_from $commands" -a disable -d "Disable extension"
complete -c gnome-extensions -n "not __fish_seen_subcommand_from $commands" -a reset -d "Reset extension"
complete -c gnome-extensions -n "not __fish_seen_subcommand_from $commands" -a uninstall -d "Uninstall extension"
complete -c gnome-extensions -n "not __fish_seen_subcommand_from $commands" -a list -d "List extensions"
complete -c gnome-extensions -n "not __fish_seen_subcommand_from $commands" -a "info show" -d "Show extension info"
complete -c gnome-extensions -n "not __fish_seen_subcommand_from $commands" -a "prefs" -d "Open extension preferences"
complete -c gnome-extensions -n "not __fish_seen_subcommand_from $commands" -a "create" -d "Create extension"
complete -c gnome-extensions -n "not __fish_seen_subcommand_from $commands" -a "pack" -d "Package extension"
complete -c gnome-extensions -n "not __fish_seen_subcommand_from $commands" -a "install" -d "Install extension bundle"
complete -c gnome-extensions -n "not __fish_seen_subcommand_from $commands" -a prefs -d "Open extension preferences"
complete -c gnome-extensions -n "not __fish_seen_subcommand_from $commands" -a create -d "Create extension"
complete -c gnome-extensions -n "not __fish_seen_subcommand_from $commands" -a pack -d "Package extension"
complete -c gnome-extensions -n "not __fish_seen_subcommand_from $commands" -a install -d "Install extension bundle"
complete -c gnome-extensions -n "__fish_seen_subcommand_from help && not __fish_seen_subcommand_from $commands_without_help" -a "$commands"
complete -c gnome-extensions -n "__fish_seen_subcommand_from enable && not __fish_seen_subcommand_from (__fish_gnome-extensions_complete_disabled_extensions)" -a "(__fish_gnome-extensions_complete_disabled_extensions)"
@ -53,11 +53,11 @@ complete -c gnome-extensions -n "__fish_seen_subcommand_from list" -l prefs -d "
complete -c gnome-extensions -n "__fish_seen_subcommand_from list" -l updates -d "Show extensions with updates"
complete -c gnome-extensions -n "__fish_seen_subcommand_from list" -s d -l details -d "Print extension details"
complete -c gnome-extensions -n "__fish_seen_subcommand_from info show && not __fish_seen_subcommand_from (__fish_gnome-extensions_complete_enabled_extensions)" -a "(__fish_gnome-extensions_complete_enabled_extensions)" -d "Enabled"
complete -c gnome-extensions -n "__fish_seen_subcommand_from info show && not __fish_seen_subcommand_from (__fish_gnome-extensions_complete_disabled_extensions)" -a "(__fish_gnome-extensions_complete_disabled_extensions)" -d "Disabled"
complete -c gnome-extensions -n "__fish_seen_subcommand_from info show && not __fish_seen_subcommand_from (__fish_gnome-extensions_complete_enabled_extensions)" -a "(__fish_gnome-extensions_complete_enabled_extensions)" -d Enabled
complete -c gnome-extensions -n "__fish_seen_subcommand_from info show && not __fish_seen_subcommand_from (__fish_gnome-extensions_complete_disabled_extensions)" -a "(__fish_gnome-extensions_complete_disabled_extensions)" -d Disabled
complete --keep-order -c gnome-extensions -n "__fish_seen_subcommand_from prefs && not __fish_seen_subcommand_from (__fish_gnome-extensions_complete_disabled_extensions_with_preferences) (__fish_gnome-extensions_complete_enabled_extensions_with_preferences)" -a "(__fish_gnome-extensions_complete_disabled_extensions_with_preferences)" -d "Disabled"
complete --keep-order -c gnome-extensions -n "__fish_seen_subcommand_from prefs && not __fish_seen_subcommand_from (__fish_gnome-extensions_complete_disabled_extensions_with_preferences) (__fish_gnome-extensions_complete_enabled_extensions_with_preferences)" -a "(__fish_gnome-extensions_complete_enabled_extensions_with_preferences)" -d "Enabled"
complete --keep-order -c gnome-extensions -n "__fish_seen_subcommand_from prefs && not __fish_seen_subcommand_from (__fish_gnome-extensions_complete_disabled_extensions_with_preferences) (__fish_gnome-extensions_complete_enabled_extensions_with_preferences)" -a "(__fish_gnome-extensions_complete_disabled_extensions_with_preferences)" -d Disabled
complete --keep-order -c gnome-extensions -n "__fish_seen_subcommand_from prefs && not __fish_seen_subcommand_from (__fish_gnome-extensions_complete_disabled_extensions_with_preferences) (__fish_gnome-extensions_complete_enabled_extensions_with_preferences)" -a "(__fish_gnome-extensions_complete_enabled_extensions_with_preferences)" -d Enabled
complete -x -c gnome-extensions -n "__fish_seen_subcommand_from create && not __fish_seen_argument -l uuid" -l uuid -d "The unique identifier of the new extension"
complete -x -c gnome-extensions -n "__fish_seen_subcommand_from create && not __fish_seen_argument -l name" -l name -d "The user-visible name of the new extension"
@ -77,4 +77,3 @@ complete -c gnome-extensions -n "__fish_seen_subcommand_from install && not __fi
complete -F -c gnome-extensions -n "__fish_seen_subcommand_from install" -d "Extension bundle"
complete -c gnome-extensions -n "__fish_seen_subcommand_from $commands_with_quiet" -s q -l quiet -d "Do not print error messages"

View File

@ -4,6 +4,6 @@ if test -d /dev/fd
complete -c isatty -k -a "(string replace /dev/fd/ '' /dev/fd/*)"
end
complete -c isatty -k -a "stderr" -d "2"
complete -c isatty -k -a "stdout" -d "1"
complete -c isatty -k -a "stdin" -d "0"
complete -c isatty -k -a stderr -d 2
complete -c isatty -k -a stdout -d 1
complete -c isatty -k -a stdin -d 0

View File

@ -46,4 +46,3 @@ complete --condition '__fish_seen_subcommand_from config' --command lxc --no-fil
set -l subcommands_taking_name console copy delete exec export info move pause publish rename restart restore shell snapshot start stop
complete --condition "__fish_seen_subcommand_from $subcommands_taking_name" --command lxc --no-files --arguments "(__fish_lxc_list_containers)"

View File

@ -10,4 +10,3 @@ complete -c optimus-manager -l print-startup -d 'Print the GPU mode that will be
complete -c optimus-manager -l unset-temp-config -d 'Undo --temp-config (unset temp config path)'
complete -c optimus-manager -l no-confirm -d 'Do not ask for confirmation and skip all warnings when switching GPUs'
complete -c optimus-manager -l cleanup -d 'Remove auto-generated configuration files left over by the daemon'

View File

@ -1,37 +1,37 @@
# Completion for SOPS (Secrets OPerationS)
function __fish_sops_no_subcommand --description "Test if there is a subcommand given"
not __fish_sops_print_remaining_args
not __fish_sops_print_remaining_args
end
function __fish_sops_print_remaining_args --description "Print remaining argument given"
set -l cmd (commandline -poc) (commandline -ct)
set -e cmd[1]
set -l opts d/decrypt e/encrypt r/rotate i/in-place s/show-master-keys v/version
set -a opts extract ignore-mac verbose enable-local-keyservice
set -a opts k/kms= p/pgp= a/age=
set -a opts gcp-kms= aws-profile= azure-kv= hc-vault-transit= input-type= output-type=
set -a opts add-gcp-kms= rm-gcp-kms= add-azure-kv= rm-azure-kv= add-kms= rm-kms=
set -a opts add-hc-vault-transit= rm-hc-vault-transit= add-age= rm-age= add-pgp= rm-pgp=
set -a opts unencrypted-suffix= encrypted-suffix= unencrypted-regex= encrypted-regex=
set -a opts config= encryption-context= set= shamir-secret-sharing-threshold= output= keyservice=
argparse -s $opts -- $cmd 2>/dev/null
if test -n "$argv"
and not string match -qr '^-' $argv[1]
string join0 -- $argv
return 0
else
return 1
end
set -l cmd (commandline -poc) (commandline -ct)
set -e cmd[1]
set -l opts d/decrypt e/encrypt r/rotate i/in-place s/show-master-keys v/version
set -a opts extract ignore-mac verbose enable-local-keyservice
set -a opts k/kms= p/pgp= a/age=
set -a opts gcp-kms= aws-profile= azure-kv= hc-vault-transit= input-type= output-type=
set -a opts add-gcp-kms= rm-gcp-kms= add-azure-kv= rm-azure-kv= add-kms= rm-kms=
set -a opts add-hc-vault-transit= rm-hc-vault-transit= add-age= rm-age= add-pgp= rm-pgp=
set -a opts unencrypted-suffix= encrypted-suffix= unencrypted-regex= encrypted-regex=
set -a opts config= encryption-context= set= shamir-secret-sharing-threshold= output= keyservice=
argparse -s $opts -- $cmd 2>/dev/null
if test -n "$argv"
and not string match -qr '^-' $argv[1]
string join0 -- $argv
return 0
else
return 1
end
end
function __fish_sops_commands --description "Test if argument(s) match a sops command"
set -l args (__fish_sops_print_remaining_args | string split0)
if string match -qr $argv $args[1]
return 0
else
return 1
end
set -l args (__fish_sops_print_remaining_args | string split0)
if string match -qr $argv $args[1]
return 0
else
return 1
end
end
# Primary commands

View File

@ -17,7 +17,7 @@ complete -x -c string -n 'test (count (commandline -opc)) -ge 2' -n 'string matc
complete -x -c string -n 'test (count (commandline -opc)) -ge 2' -n 'string match -qr split0\?\$ -- (commandline -opc)[2]' -s f -l fields -a "(seq 1 10)" -d "Specify fields"
complete -f -c string -n 'test (count (commandline -opc)) -ge 2' -n 'string match -qr split0\?\$ -- (commandline -opc)[2]' -s r -l right -d "Split right-to-left"
complete -f -c string -n 'test (count (commandline -opc)) -ge 2' -n 'string match -qr split0\?\$ -- (commandline -opc)[2]' -s n -l no-empty -d "Empty results excluded"
complete -f -c string -n "test (count (commandline -opc)) -lt 2" -a 'collect'
complete -f -c string -n "test (count (commandline -opc)) -lt 2" -a collect
complete -f -c string -n 'test (count (commandline -opc)) -ge 2' -n 'string match -qr collect\$ -- (commandline -opc)[2]' -s N -l no-trim-newlines -d "Don't trim trailing newlines"
complete -f -c string -n 'test (count (commandline -opc)) -ge 2' -n 'string match -qr collect\$ -- (commandline -opc)[2]' -s a -l allow-empty -d "Always print empty argument"

View File

@ -11,7 +11,7 @@ function __fish_complete_gpg_key_id -d 'Complete using gpg key ids' -a __fish_co
set -l __uid (string split ":" -- $garbage)
set -l uid (string replace -a '\x3a' ':' -- $__uid[10])
printf "%s\t%s\n" $keyid $uid
# NOTE key is preceded by "sec" instead of "pub" when listing secret keys
# NOTE key is preceded by "sec" instead of "pub" when listing secret keys
case "pub*" "sec*"
# Extract key fingerprints (no subkeys)
set -l __pub (string split ":" -- $garbage)

View File

@ -49,7 +49,7 @@ function fish_add_path --description "Add paths to the PATH"
# Ignore non-existing paths
if not test -d "$p"
# path does not exist
if set -q _flag_verbose;
if set -q _flag_verbose
# print a message in verbose mode
printf (_ "Skipping non-existent path: %s\n") "$p"
end

View File

@ -64,7 +64,7 @@ def find_executable(exe, paths=()):
def isMacOS10_12_5_OrLater():
""" Return whether this system is macOS 10.12.5 or a later version. """
"""Return whether this system is macOS 10.12.5 or a later version."""
try:
return [int(x) for x in platform.mac_ver()[0].split(".")] >= [10, 12, 5]
except ValueError:
@ -72,7 +72,7 @@ def isMacOS10_12_5_OrLater():
def is_wsl():
""" Return whether we are running under the Windows Subsystem for Linux """
"""Return whether we are running under the Windows Subsystem for Linux"""
if "linux" in platform.system().lower() and os.access("/proc/version", os.R_OK):
with open("/proc/version", "r") as f:
# Find 'Microsoft' for wsl1 and 'microsoft' for wsl2
@ -82,22 +82,24 @@ def is_wsl():
def is_sailfish_os():
""" Return whether we are running on Sailfish OS """
if "linux" in platform.system().lower() and os.access("/etc/sailfish-release", os.R_OK):
"""Return whether we are running on Sailfish OS"""
if "linux" in platform.system().lower() and os.access(
"/etc/sailfish-release", os.R_OK
):
with open("/etc/sailfish-release", "r") as f:
# Find 'ID=sailfishos'
if "sailfishos" in f.read():
return True
return False
return False
def is_termux():
""" Return whether we are running under the Termux application for Android"""
"""Return whether we are running under the Termux application for Android"""
return "com.termux" in os.environ["PATH"] and find_executable("termux-open-url")
def is_chromeos_garcon():
""" Return whether we are running in Chrome OS and the browser can't see local files """
"""Return whether we are running in Chrome OS and the browser can't see local files"""
# In Crostini Chrome OS Linux, the default browser opens URLs in Chrome
# running outside the linux VM. This browser does not have access to the
# Linux filesystem. This uses Garcon, see for example
@ -139,6 +141,7 @@ def escape_fish_cmd(text):
escaped = text.replace("\\", "\\\\").replace("'", "\\'")
return "'" + escaped + "'"
def strip_one_layer(text, char):
# Strip the text from one layer of a given character
if text[-1] == char:
@ -177,7 +180,7 @@ bindings_blacklist = set(["self-insert", "'begin;end'"])
def parse_one_color(comp):
""" A basic function to parse a single color value like 'FFA000' """
"""A basic function to parse a single color value like 'FFA000'"""
if comp in named_colors:
# Named color
return named_colors[comp]
@ -193,7 +196,7 @@ def parse_one_color(comp):
def better_color(c1, c2):
""" Indicate which color is "better", i.e. prefer term256 colors """
"""Indicate which color is "better", i.e. prefer term256 colors"""
if not c2:
return c1
if not c1:
@ -241,7 +244,7 @@ def parse_color(color_str):
skip = len("-b")
if comp[len("-b=")] in ["=", " "]:
skip += 1
c = comp[skip :]
c = comp[skip:]
parsed_c = parse_one_color(c)
if better_color(background_color, parsed_c) == parsed_c:
background_color = c
@ -261,6 +264,7 @@ def parse_color(color_str):
"reverse": reverse,
}
def unparse_color(col):
"""A basic function to return the fish version of a color dict"""
if isinstance(col, str):
@ -282,6 +286,7 @@ def unparse_color(col):
ret += " --background=" + col["background"]
return ret
def parse_bool(val):
val = val.lower()
if val.startswith("f") or val.startswith("0"):
@ -589,11 +594,11 @@ def get_special_ansi_escapes():
print("WARNING: Rebuild python with curses headers!")
g_special_escapes_dict = {
'exit_attribute_mode': '\x1b(B\x1b[m',
'bold': '\x1b[1m',
'underline': '\x1b[4m'
"exit_attribute_mode": "\x1b(B\x1b[m",
"bold": "\x1b[1m",
"underline": "\x1b[4m",
}
return g_special_escapes_dict
@ -723,7 +728,7 @@ def ansi_to_html(val):
class FishVar:
""" A class that represents a variable """
"""A class that represents a variable"""
def __init__(self, name, value):
self.name = name
@ -742,7 +747,7 @@ class FishVar:
class FishBinding:
"""A class that represents keyboard binding """
"""A class that represents keyboard binding"""
def __init__(self, command, raw_binding, readable_binding, description=None):
self.command = command
@ -769,7 +774,7 @@ class FishBinding:
class BindingParser:
""" Class to parse codes for bind command """
"""Class to parse codes for bind command"""
# TODO: What does snext and sprevious mean ?
readable_keys = {
@ -788,13 +793,13 @@ class BindingParser:
}
def set_buffer(self, buffer):
""" Sets code to parse """
"""Sets code to parse"""
self.buffer = buffer or b""
self.index = 0
def get_char(self):
""" Gets next character from buffer """
"""Gets next character from buffer"""
if self.index >= len(self.buffer):
return "\0"
c = self.buffer[self.index]
@ -802,17 +807,17 @@ class BindingParser:
return c
def unget_char(self):
""" Goes back by one character for parsing """
"""Goes back by one character for parsing"""
self.index -= 1
def end(self):
""" Returns true if reached end of buffer """
"""Returns true if reached end of buffer"""
return self.index >= len(self.buffer)
def parse_control_sequence(self):
""" Parses terminal specifiec control sequences """
"""Parses terminal specifiec control sequences"""
result = ""
c = self.get_char()
@ -868,7 +873,7 @@ class BindingParser:
return result
def get_readable_binding(self):
""" Gets a readable representation of binding """
"""Gets a readable representation of binding"""
try:
result = BindingParser.readable_keys[self.buffer.lower()]
@ -947,7 +952,7 @@ class FishConfigHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
self.wfile.write(txt.encode("utf-8"))
def do_get_colors(self, path=None):
""" Read the colors from a .theme file in path, or the current shell if no path has been given """
"""Read the colors from a .theme file in path, or the current shell if no path has been given"""
# Looks for fish_color_*.
# Returns an array of lists [color_name, color_description, color_value]
result = []
@ -1010,21 +1015,23 @@ class FishConfigHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
extrainfo = {}
for line in out.split("\n"):
# Ignore empty lines
if not line: continue
if not line:
continue
# Lines starting with "#" can contain metadata.
if line.startswith("#"):
if not ":" in line: continue
if not ":" in line:
continue
key, value = line.split(":", maxsplit=1)
key = key.strip("# '")
value = value.strip(" '\"")
# Only use keys we know
if not key in ("name", "preferred_background", "url"): continue
if not key in ("name", "preferred_background", "url"):
continue
if key == "preferred_background":
if value not in named_colors and not value.startswith("#"):
value = "#" + value
extrainfo[key] = value
for match in re.finditer(r"^fish_(pager_)?color_(\S+) ?(.*)", line):
color_name, color_value = [x.strip() for x in match.group(2, 3)]
if match.group(1):
@ -1057,7 +1064,7 @@ class FishConfigHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
return out.strip().split(", ")
def do_get_variable_names(self, cmd):
" Given a command like 'set -U' return all the variable names "
"Given a command like 'set -U' return all the variable names"
out, err = run_fish_cmd(cmd)
return out.split("\n")
@ -1091,7 +1098,7 @@ class FishConfigHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
]
def do_get_bindings(self):
""" Get key bindings """
"""Get key bindings"""
# Running __fish_config_interactive print fish greeting and
# loads key bindings
@ -1206,20 +1213,36 @@ class FishConfigHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
return True
def do_set_prompt_function(self, prompt_func):
cmd = "functions -e fish_right_prompt; " + prompt_func + "\n" + "funcsave fish_prompt && funcsave fish_right_prompt 2>/dev/null"
cmd = (
"functions -e fish_right_prompt; "
+ prompt_func
+ "\n"
+ "funcsave fish_prompt && funcsave fish_right_prompt 2>/dev/null"
)
out, err = run_fish_cmd(cmd)
return len(err) == 0
def do_get_prompt(self, prompt_function_text, extras_dict):
# Return the prompt output by the given command
cmd = prompt_function_text + '\n builtin cd "' + initial_wd + '" \n false \n fish_prompt\n'
cmd = (
prompt_function_text
+ '\n builtin cd "'
+ initial_wd
+ '" \n false \n fish_prompt\n'
)
prompt_demo_ansi, err = run_fish_cmd(cmd)
prompt_demo_html = ansi_to_html(prompt_demo_ansi)
right_demo_ansi, err = run_fish_cmd(
"functions -e fish_right_prompt; " + prompt_function_text + '\n builtin cd "' + initial_wd + '" \n false \n functions -q fish_right_prompt && fish_right_prompt\n'
"functions -e fish_right_prompt; "
+ prompt_function_text
+ '\n builtin cd "'
+ initial_wd
+ '" \n false \n functions -q fish_right_prompt && fish_right_prompt\n'
)
right_demo_html = ansi_to_html(right_demo_ansi)
prompt_demo_font_size = self.font_size_for_ansi_prompt(prompt_demo_ansi + right_demo_ansi)
prompt_demo_font_size = self.font_size_for_ansi_prompt(
prompt_demo_ansi + right_demo_ansi
)
result = {
"function": prompt_function_text,
"demo": prompt_demo_html,
@ -1233,7 +1256,9 @@ class FishConfigHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def do_get_current_prompt(self):
# Return the current prompt. We run 'false' to demonstrate how the
# prompt shows the command status (#1624).
prompt_func, err = run_fish_cmd("functions fish_prompt; functions fish_right_prompt")
prompt_func, err = run_fish_cmd(
"functions fish_prompt; functions fish_right_prompt"
)
result = self.do_get_prompt(
prompt_func.strip(),
{"name": "Current"},
@ -1391,20 +1416,25 @@ class FishConfigHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
# The rest in alphabetical order.
curcolors, curinfo = self.do_get_colors()
defcolors, definfo = self.do_get_colors("themes/fish default.theme")
curinfo.update({ "theme": "Current", "colors": curcolors})
definfo.update({ "theme": "fish default", "colors": defcolors})
curinfo.update({"theme": "Current", "colors": curcolors})
definfo.update({"theme": "fish default", "colors": defcolors})
output = [curinfo, definfo]
confighome = os.environ["XDG_CONFIG_HOME"] if "XDG_CONFIG_HOME" in os.environ else os.path.expanduser("~")
confighome = (
os.environ["XDG_CONFIG_HOME"]
if "XDG_CONFIG_HOME" in os.environ
else os.path.expanduser("~")
)
paths = list(glob.iglob(os.path.join(confighome, "fish", "themes/*.theme")))
paths.extend(list(glob.iglob("themes/*.theme")))
paths.sort(key=str.casefold)
for p in paths:
theme = os.path.splitext(os.path.basename(p))[0]
if any(theme == d["theme"] for d in output): continue
if any(theme == d["theme"] for d in output):
continue
out, outinfo = self.do_get_colors(p)
outinfo.update({ "theme": theme, "colors": out })
outinfo.update({"theme": theme, "colors": out})
output.append(outinfo)
elif p == "/functions/":
output = self.do_get_functions()
@ -1571,11 +1601,11 @@ class FishConfigHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
self.write_to_wfile(json.dumps(output))
def log_request(self, code="-", size="-"):
""" Disable request logging """
"""Disable request logging"""
pass
def log_error(self, format, *args):
if format == "code %d, message %s" and hasattr(self, 'path'):
if format == "code %d, message %s" and hasattr(self, "path"):
# This appears to be a send_error() message
# We want to include the path (if we have one)
(code, msg) = args

View File

@ -1893,7 +1893,8 @@ std::string get_executable_path(const char *argv0) {
std::string buffstr{buff};
if (access(buff, F_OK)) {
auto dellen = const_strlen(" (deleted)");
if (buffstr.size() > dellen && buffstr.compare(buffstr.size() - dellen, dellen, " (deleted)") == 0) {
if (buffstr.size() > dellen &&
buffstr.compare(buffstr.size() - dellen, dellen, " (deleted)") == 0) {
buffstr = buffstr.substr(0, buffstr.size() - const_strlen(" (deleted)"));
}
}

View File

@ -343,7 +343,7 @@ expect_str("bound ctrl-z")
# Check that the builtin version of `exit` works
# (for obvious reasons this MUST BE LAST)
sendline('function myexit; echo exit; exit; end; bind \cz myexit')
sendline("function myexit; echo exit; exit; end; bind \cz myexit")
expect_prompt()
send("\x1A")
expect_str("exit")

View File

@ -47,6 +47,7 @@ if "CI" in os.environ:
# This doesn't work under TSan, because TSan prevents select() being
# interrupted by a signal.
import sys
print("SKIPPING the last of bind_mode_events.py")
sys.exit(0)

View File

@ -19,6 +19,7 @@ if "CI" in os.environ:
# This doesn't work under TSan, because TSan prevents select() being
# interrupted by a signal.
import sys
print("SKIPPING cancel_event.py")
sys.exit(0)

View File

@ -18,7 +18,7 @@ expect_prompt()
# Hack: NetBSD's sleep likes quitting when waking up
# (but also does so under /bin/sh)
testproc="sleep 500" if platform.system() != "NetBSD" else "cat"
testproc = "sleep 500" if platform.system() != "NetBSD" else "cat"
sendline(testproc)
sendline("set -l foo bar; echo $foo")
expect_str("")

View File

@ -148,14 +148,14 @@ expect_prompt("TERM")
# Check that leading space makes an ephemeral item
sendline(" echo ephemeral")
expect_prompt("ephemeral")
send("\x1b[A") # up-arrow
send("\x1b[A") # up-arrow
expect_re(" echo ephemeral")
sendline("")
expect_prompt("ephemeral")
sendline(" ")
expect_prompt()
send("\x1b[A")
expect_re("echo TERM") # not ephemeral!
expect_re("echo TERM") # not ephemeral!
# Verify that clear-session works as expected
# Note: This test depends on that history merge resets the session from history clear-sessions point of view.
@ -173,7 +173,7 @@ expect_prompt()
# create after history
sendline("echo after")
expect_prompt()
#clear session
# clear session
sendline("history clear-session")
expect_prompt()
sendline("history search --exact 'echo after' | cat")

View File

@ -146,7 +146,9 @@ expect_str("ghi then jkl\r\n")
expect_prompt()
# Long line so we don't have to count prompts
sendline("""set -g fish_prompt_fired 0; function dontfire --on-event fish_prompt; set -g fish_prompt_fired (math $fish_prompt_fired + 1); end; function dofire --on-event fish_read; set -g fish_read_fired 1; end""")
sendline(
"""set -g fish_prompt_fired 0; function dontfire --on-event fish_prompt; set -g fish_prompt_fired (math $fish_prompt_fired + 1); end; function dofire --on-event fish_read; set -g fish_read_fired 1; end"""
)
expect_prompt()
sendline("read foo")

View File

@ -59,7 +59,7 @@ expect_prompt()
sendline("sleep 5")
sleep(0.100)
subprocess.call(["pkill", "-TERM", "-P", str(sp.spawn.pid), "sleep"])
subprocess.call(["pkill", "-TERM", "-P", str(sp.spawn.pid), "sleep"])
expect_str("fish_kill_signal 15")
expect_prompt()

View File

@ -3,7 +3,7 @@ from pexpect_helper import SpawnedProc
import platform
# Set a 0 terminal size
sp = SpawnedProc(args=["-d", "term-support"], dimensions=(0,0))
sp = SpawnedProc(args=["-d", "term-support"], dimensions=(0, 0))
send, sendline, sleep, expect_prompt, expect_re, expect_str = (
sp.send,
sp.sendline,
@ -59,6 +59,5 @@ if platform.system() in ["Linux"]:
# This should not match because we should not get any output.
# Unfortunately we have to wait for the timeout to expire - set it to a second.
expect_str("hellohello", timeout=1, shouldfail=True)
send("\x11") # ctrl-q to resume flow
send("\x11") # ctrl-q to resume flow
expect_prompt("hellohello")