fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
0df6fa791
master
1# fish completion for arc 2 3function __fish_arc_needs_command 4set -l cmd( commandline -xpc) 5if not set -q cmd[ 2 ] 6return 0 7else 8set -l skip_next1 9# Skip first word because it's "arc" or a wrapper 10for cin $cmd [ 2 .. -1 ] 11switch $c 12# General options that can still take a command 13case --trace --no-ansi --ansi --load-phutil-library config skip-arcconfig arcrc-file --conduit-{ uri, token, version, timeout} 14continue 15case "*" 16echo $c 17return 1 18end 19end 20return 0 21end 22return 1 23end 24 25function __fish_arc_using_command 26set -l cmd( __fish_arc_needs_command ) 27test -z " $cmd " 28and return 1 29contains --$cmd $argv 30and return 0 31end 32 33### Global options 34complete -f -c arc -n __fish_arc_needs_command -l trace -d'Debugging command' 35complete -f -c arc -n __fish_arc_needs_command -l no-ansi -d'Don\'t use color or style for output' 36complete -f -c arc -n __fish_arc_needs_command -l ansi -d'Always use formatting' 37complete -f -c arc -n __fish_arc_needs_command -l no-ansi -d'Don\'t use color or style for output' 38complete -f -c arc -n __fish_arc_needs_command -l load-phutil-library -d'Specify which libraries to load' 39complete -f -c arc -n __fish_arc_needs_command -l conduit-uri -d'Specify the Conduit URI' 40complete -f -c arc -n __fish_arc_needs_command -l conduit-token -d'Specify the Conduit token' 41complete -f -c arc -n __fish_arc_needs_command -l conduit-version -d'Force a version' 42complete -f -c arc -n __fish_arc_needs_command -l conduit-timeout -d'Sets the timeout' 43complete -f -c arc -n __fish_arc_needs_command -l config -d'Sets a config' 44complete -f -c arc -n __fish_arc_needs_command -l skip-arcconfig -d'Skip the working copy configuration file' 45complete -c arc -n __fish_arc_needs_command -l arcrc-file -d'Use provided file instead of ~/.arcrc' 46 47### shell-complete 48complete -f -c arc -n __fish_arc_needs_command -a shell-complete -d'Implements shell completion' 49complete -f -c arc -n'__fish_arc_using_command shell-complete' -l current -d'Current term in the argument list being completed' 50 51### get-config 52complete -f -c arc -n __fish_arc_needs_command -a get-config -d'Reads an arc configuration option' 53complete -f -c arc -n'__fish_arc_using_command get-config' -l verbose -d'Show detailed information about options' 54 55### download 56complete -f -c arc -n __fish_arc_needs_command -a download -d'Download a file to local disk' 57complete -c arc -n'__fish_arc_using_command download' -l as -d'Save the file with a specific name rather than the default' 58complete -f -c arc -n'__fish_arc_using_command download' -l show -d'Write file to stdout instead of to disk' 59 60### list 61complete -f -c arc -n __fish_arc_needs_command -a list -d'List your open Differential revisions' 62 63### lint 64complete -f -c arc -n __fish_arc_needs_command -a lint -d'Run static analysis on changes to check for mistakes' 65complete -f -c arc -n'__fish_arc_using_command lint' -l engine -d'Override configured lint engine for this project' 66complete -f -c arc -n'__fish_arc_using_command lint' -l apply-patches -d'Apply patches suggested by lint to the working copy' 67complete -f -c arc -n'__fish_arc_using_command lint' -l severity -d'Set minimum message severity' 68complete -f -c arc -n'__fish_arc_using_command lint' -l never-apply-patches -d'Never apply patches suggested by lint' 69complete -f -c arc -n'__fish_arc_using_command lint' -l rev -d'Lint changes since a specific revision' 70complete -c arc -n'__fish_arc_using_command lint' -l outfile -d'Output the linter results to a file' 71complete -f -c arc -n'__fish_arc_using_command lint' -l lintall -d'Show all lint warnings, not just those on changed lines' 72complete -f -c arc -n'__fish_arc_using_command lint' -l amend-all -d'When linting git repositories, amend HEAD with all patches' 73complete -f -c arc -n'__fish_arc_using_command lint' -l everything -d'Lint all files in the project' 74complete -f -c arc -n'__fish_arc_using_command lint' -l output -d'Specify how results will be displayed' 75complete -f -c arc -n'__fish_arc_using_command lint' -l only-new -d'Display only messages not present in the original code' 76complete -f -c arc -n'__fish_arc_using_command lint' -l only-changed -d'Show lint warnings just on changed lines' 77complete -f -c arc -n'__fish_arc_using_command lint' -l amend-autofixes -d'When linting git repositories, amend HEAD with autofix' 78 79### flag 80complete -f -c arc -n __fish_arc_needs_command -a flag -d'In the first form, list objects you\'ve flagged' 81complete -f -c arc -n'__fish_arc_using_command flag' -l edit -d'Edit the flag on an object' 82complete -f -c arc -n'__fish_arc_using_command flag' -l color -d'Set the color of a flag' 83complete -f -c arc -n'__fish_arc_using_command flag' -l clear -d'Delete the flag on an object' 84complete -f -c arc -n'__fish_arc_using_command flag' -l note -d'Set the note on a flag' 85 86### export 87complete -c arc -n __fish_arc_needs_command -a export -d'Export the local changeset to a file' 88complete -f -c arc -n'__fish_arc_using_command export' -l unified -d'Export change as a unified patch' 89complete -f -c arc -n'__fish_arc_using_command export' -l git -d'Export change as a git patch' 90complete -f -c arc -n'__fish_arc_using_command export' -l encoding -d'Attempt to convert non UTF-8 patch into specified encoding' 91complete -f -c arc -n'__fish_arc_using_command export' -l arcbundle -d'Export change as an arc bundle' 92complete -f -c arc -n'__fish_arc_using_command export' -l diff -d'Export from Differential diff' 93complete -f -c arc -n'__fish_arc_using_command export' -l revision -d'Export from a Differential revision' 94 95### browse 96complete -c arc -n __fish_arc_needs_command -a browse -d'Open a file or object in your web browser' 97complete -f -c arc -n'__fish_arc_using_command browse' -l force -d'Open arguments as paths, even if they do not exist in the working copy' 98complete -f -c arc -n'__fish_arc_using_command browse' -l branch -d'Default branch name to view on server' 99 100### todo 101complete -f -c arc -n __fish_arc_needs_command -a todo -d'Quickly create a task for yourself' 102complete -f -c arc -n'__fish_arc_using_command todo' -l cc -d'Other users to CC on the new task' 103complete -f -c arc -n'__fish_arc_using_command todo' -l project -d'Projects to assign to the task' 104complete -f -c arc -n'__fish_arc_using_command todo' -l browse -d'After creating the task, open it in a web browser' 105 106### linters 107complete -f -c arc -n __fish_arc_needs_command -a linters -d'what they do and which versions are installed' 108complete -f -c arc -n'__fish_arc_using_command linters' -l search -d'Search for linters' 109complete -f -c arc -n'__fish_arc_using_command linters' -l verbose -d'Show detailed information, including options' 110 111### time 112complete -f -c arc -n __fish_arc_needs_command -a time -d'Show what you\'re currently tracking in Phrequent' 113 114### stop 115complete -f -c arc -n __fish_arc_needs_command -a stop -d'Stop tracking work in Phrequent' 116complete -f -c arc -n'__fish_arc_using_command stop' -l note -d'A note to attach to the tracked time' 117 118### alias 119complete -f -c arc -n __fish_arc_needs_command -a alias -d'Create an alias' 120 121### set-config 122complete -f -c arc -n __fish_arc_needs_command -a set-config -d'Sets an arc configuration option' 123complete -f -c arc -n'__fish_arc_using_command set-config' -l local -d'Set a local config value instead of a user one' 124 125### start 126complete -f -c arc -n __fish_arc_needs_command -a start -d'Start tracking work in Phrequent' 127 128### close 129complete -f -c arc -n __fish_arc_needs_command -a close -d'Close a task or otherwise update its status' 130complete -f -c arc -n'__fish_arc_using_command close' -l message -d'Provide a comment with your status change' 131complete -f -c arc -n'__fish_arc_using_command close' -l list-statuses -d'Show available status options and exit' 132 133### land 134complete -f -c arc -n __fish_arc_needs_command -a land -d'Publish an accepted revision after review' 135complete -f -c arc -n'__fish_arc_using_command land' -l preview -d'Prints the commits that would be landed' 136complete -f -c arc -n'__fish_arc_using_command land' -l remote -d'Push to a remote other than the default' 137complete -f -c arc -n'__fish_arc_using_command land' -l delete-remote -d'Delete the feature branch in the remote after landing it' 138complete -f -c arc -n'__fish_arc_using_command land' -l update-with-rebase -d'When updating the feature branch, use rebase instead of merge' 139complete -f -c arc -n'__fish_arc_using_command land' -l squash -d'Use squash strategy' 140complete -f -c arc -n'__fish_arc_using_command land' -l keep-branch -d'Keep the feature branch' 141complete -f -c arc -n'__fish_arc_using_command land' -l merge -d'Use merge strategy' 142complete -f -c arc -n'__fish_arc_using_command land' -l update-with-merge -d'When updating the feature branch, use merge instead of rebase' 143complete -f -c arc -n'__fish_arc_using_command land' -l hold -d'Prepare the change to be pushed, but do not actually push it' 144complete -f -c arc -n'__fish_arc_using_command land' -l onto -d'Land feature branch onto a branch other than the default' 145complete -f -c arc -n'__fish_arc_using_command land' -l revision -d'Use the message from a specific revision' 146 147### which 148complete -f -c arc -n __fish_arc_needs_command -a which -d'Show which commits will be selected' 149complete -f -c arc -n'__fish_arc_using_command which' -l show-base -d'Print base commit only and exit' 150complete -f -c arc -n'__fish_arc_using_command which' -l base -d'Additional rules for determining base revision' 151complete -f -c arc -n'__fish_arc_using_command which' -l head -d'Specify the end of the commit range to select' 152complete -f -c arc -n'__fish_arc_using_command which' -l any-status -d'Show committed and abandoned revisions' 153 154### bookmark 155complete -f -c arc -n __fish_arc_needs_command -a bookmark -d'Alias for arc feature' 156 157### amend 158complete -f -c arc -n __fish_arc_needs_command -a amend -d'Amend the working copy' 159complete -f -c arc -n'__fish_arc_using_command amend' -l revision -d'Use the message from a specific revision' 160complete -f -c arc -n'__fish_arc_using_command amend' -l show -d'Show the amended commit message' 161 162### upgrade 163complete -f -c arc -n __fish_arc_needs_command -a upgrade -d'Upgrade arcanist and libphutil to the latest versions' 164 165### help 166complete -f -c arc -n __fish_arc_needs_command -a help -d'Shows the help' 167complete -f -c arc -n'__fish_arc_using_command help' -l full -d'Print detailed information about each command' 168 169### paste 170complete -f -c arc -n __fish_arc_needs_command -a paste -d'Share and grab text using the Paste application' 171complete -f -c arc -n'__fish_arc_using_command paste' -l lang -d'Language for syntax highlighting' 172complete -f -c arc -n'__fish_arc_using_command paste' -l json -d'Output in JSON format' 173complete -f -c arc -n'__fish_arc_using_command paste' -l title -d'Title for the paste' 174 175### commit 176complete -f -c arc -n __fish_arc_needs_command -a commit -d'Commit a revision which has been accepted by a reviewer' 177complete -f -c arc -n'__fish_arc_using_command commit' -l revision -d'Commit a specific revision' 178complete -f -c arc -n'__fish_arc_using_command commit' -l show -d'Show the command which would be issued' 179 180### patch 181complete -f -c arc -n __fish_arc_needs_command -a patch -d'Apply changes to the working copy' 182complete -f -c arc -n'__fish_arc_using_command patch' -l force -d'Do not run any sanity checks' 183complete -f -c arc -n'__fish_arc_using_command patch' -l encoding -d'Attempt to convert non UTF-8 patch into specified encoding' 184complete -f -c arc -n'__fish_arc_using_command patch' -l nocommit -d'Do not commit the changes' 185complete -f -c arc -n'__fish_arc_using_command patch' -l update -d'Update the local working copy before applying the patch' 186complete -c arc -n'__fish_arc_using_command patch' -l patch -d'Apply changes from a git patch file or unified patch file' 187complete -f -c arc -n'__fish_arc_using_command patch' -l arcbundle -d'Apply changes from an arc bundlej' 188complete -f -c arc -n'__fish_arc_using_command patch' -l skip-dependencies -d'Do not apply dependencies' 189complete -f -c arc -n'__fish_arc_using_command patch' -l diff -d'Apply changes from a Differential diff' 190complete -f -c arc -n'__fish_arc_using_command patch' -l nobranch -d'Do not create a branch' 191complete -f -c arc -n'__fish_arc_using_command patch' -l revision -d'Apply changes from a Differential revision' 192 193### install-certificate 194complete -f -c arc -n __fish_arc_needs_command -a install-certificate -d'Installs Conduit credentials into your ~/.arcc' 195 196### revert 197complete -f -c arc -n __fish_arc_needs_command -a revert -d'Please use backout instead' 198 199### upload 200complete -c arc -n __fish_arc_needs_command -a upload -d'Upload a file from local disk' 201complete -f -c arc -n'__fish_arc_using_command upload' -l json -d'Output upload information in JSON format' 202complete -f -c arc -n'__fish_arc_using_command upload' -l temporary -d'Mark the file as temporary' 203 204### branch 205complete -f -c arc -n __fish_arc_needs_command -a branch -d'Alias for arc feature' 206 207### anoid 208complete -f -c arc -n __fish_arc_needs_command -a anoid -d'There\'s only one way to find out' 209 210### cover 211complete -f -c arc -n __fish_arc_needs_command -a cover -d'Show blame for the lines you changed' 212complete -f -c arc -n'__fish_arc_using_command cover' -l rev -d'Cover changes since a specific revision' 213 214### close-revision 215complete -f -c arc -n __fish_arc_needs_command -a close-revision -d'Close a revision' 216complete -f -c arc -n'__fish_arc_using_command close-revision' -l quiet -d'Do not print a success message' 217complete -f -c arc -n'__fish_arc_using_command close-revision' -l finalize -d'Close only if the repository is untracked and the revision is accepted' 218 219### tasks 220complete -f -c arc -n __fish_arc_needs_command -a tasks -d'View all assigned tasks' 221complete -f -c arc -n'__fish_arc_using_command tasks' -l status -d'Show tasks that are open or closed, default is open' 222complete -f -c arc -n'__fish_arc_using_command tasks' -l owner -d'Only show tasks assigned to the given username,' 223complete -f -c arc -n'__fish_arc_using_command tasks' -l unassigned -d'Only show tasks that are not assigned' 224complete -f -c arc -n'__fish_arc_using_command tasks' -l limit -d'Limit the amount of tasks outputted, default is all' 225complete -f -c arc -n'__fish_arc_using_command tasks' -l order -d'Arrange tasks based on priority, created, or modified,' 226 227### feature 228complete -f -c arc -n __fish_arc_needs_command -a feature -d'A wrapper on \'git branch\' or \'hg bookmark' 229complete -f -c arc -n'__fish_arc_using_command feature' -l output -d'Specify the output format' 230complete -f -c arc -n'__fish_arc_using_command feature' -l view-all -d'Include closed and abandoned revisions' 231complete -f -c arc -n'__fish_arc_using_command feature' -l by-status -d'Sort branches by status instead of time' 232 233### unit 234complete -f -c arc -n __fish_arc_needs_command -a unit -d'Run unit tests that cover specified paths' 235complete -f -c arc -n'__fish_arc_using_command unit' -l engine -d'Override configured unit engine for this project' 236complete -f -c arc -n'__fish_arc_using_command unit' -l detailed-coverage -d'Show a detailed coverage report on the CLI' 237complete -f -c arc -n'__fish_arc_using_command unit' -l target -d'Record a copy of the test results on the specified build target' 238complete -f -c arc -n'__fish_arc_using_command unit' -l ugly -d'Use uglier formatting' 239complete -f -c arc -n'__fish_arc_using_command unit' -l rev -d'Run unit tests covering changes since a specific revision' 240complete -f -c arc -n'__fish_arc_using_command unit' -l everything -d'Run every test' 241complete -f -c arc -n'__fish_arc_using_command unit' -l json -d'Report results in JSON format' 242complete -f -c arc -n'__fish_arc_using_command unit' -l coverage -d'Always enable coverage information' 243complete -f -c arc -n'__fish_arc_using_command unit' -l output -d'Specify the output format' 244complete -f -c arc -n'__fish_arc_using_command unit' -l no-coverage -d'Always disable coverage information' 245 246### backout 247complete -f -c arc -n __fish_arc_needs_command -a backout -d'Backouts on a previous commit' 248 249### call-conduit 250complete -f -c arc -n __fish_arc_needs_command -a call-conduit -d'Make a raw Conduit method call' 251 252### diff 253complete -f -c arc -n __fish_arc_needs_command -a diff -d'Generate a Differential diff or revision from local changes' 254complete -f -c arc -n'__fish_arc_using_command diff' -l raw-command -d'Generate diff by executing a specified command' 255complete -f -c arc -n'__fish_arc_using_command diff' -l encoding -d'Attempt to convert non UTF-8 hunks into specified encoding' 256complete -f -c arc -n'__fish_arc_using_command diff' -l cc -d'When creating a revision, add CCs' 257complete -f -c arc -n'__fish_arc_using_command diff' -l reviewers -d'When creating a revision, add reviewers' 258complete -f -c arc -n'__fish_arc_using_command diff' -l skip-staging -d'Do not copy changes to the staging area' 259complete -f -c arc -n'__fish_arc_using_command diff' -l raw -d'Read diff from stdin' 260complete -f -c arc -n'__fish_arc_using_command diff' -l uncommitted -d'Suppress warning about uncommitted changes' 261complete -c arc -n'__fish_arc_using_command diff' -l message-file -d'Read revision information from file' 262complete -f -c arc -n'__fish_arc_using_command diff' -l nolint -d'Do not run lint' 263complete -f -c arc -n'__fish_arc_using_command diff' -l message -d'Use the specified message when updating a revision' 264complete -f -c arc -n'__fish_arc_using_command diff' -l plan-changes -d'Create or update a revision without requesting a code review' 265complete -f -c arc -n'__fish_arc_using_command diff' -l browse -d'After creating a diff or revision, open it in a web browser' 266complete -f -c arc -n'__fish_arc_using_command diff' -l create -d'Always create a new revision' 267complete -f -c arc -n'__fish_arc_using_command diff' -l cache -d'Disable lint cache' 268complete -f -c arc -n'__fish_arc_using_command diff' -l use-commit-message -d'Read revision information from a specific commit' 269complete -f -c arc -n'__fish_arc_using_command diff' -l only -d'Only generate a diff, without running lint, unit tests, or other' 270complete -f -c arc -n'__fish_arc_using_command diff' -l skip-binaries -d'Do not upload binaries' 271complete -f -c arc -n'__fish_arc_using_command diff' -l preview -d'only create a diff' 272complete -f -c arc -n'__fish_arc_using_command diff' -l amend-autofixes -d'When linting git repositories, amend HEAD with autofix' 273complete -f -c arc -n'__fish_arc_using_command diff' -l apply-patches -d'Apply patches suggested by lint' 274complete -f -c arc -n'__fish_arc_using_command diff' -l head -d'Specify the end of the commit range' 275complete -f -c arc -n'__fish_arc_using_command diff' -l verbatim -d'When creating a revision, try to use the working copy commit' 276complete -f -c arc -n'__fish_arc_using_command diff' -l less-context -d'Create a diff with a few lines of context.' 277complete -f -c arc -n'__fish_arc_using_command diff' -l advice -d'Require excuse for lint advice in addition to lint warnings and errors' 278complete -f -c arc -n'__fish_arc_using_command diff' -l json -d'Emit machine-readable JSON' 279complete -f -c arc -n'__fish_arc_using_command diff' -l update -d'Always update a specific revision' 280complete -f -c arc -n'__fish_arc_using_command diff' -l ignore-unsound-tests -d'Ignore unsound test failures without prompting' 281complete -f -c arc -n'__fish_arc_using_command diff' -l excuse -d'Provide a prepared in advance excuse for any lints/tests' 282complete -f -c arc -n'__fish_arc_using_command diff' -l base -d'Additional rules for determining base revision' 283complete -f -c arc -n'__fish_arc_using_command diff' -l no-amend -d'Never amend commits in the working copy with lint patches' 284complete -f -c arc -n'__fish_arc_using_command diff' -l add-all -d'Automatically add all unstaged and uncommitted' 285complete -f -c arc -n'__fish_arc_using_command diff' -l never-apply-patches -d'Never apply patches suggested by lint' 286complete -f -c arc -n'__fish_arc_using_command diff' -l edit -d'Edit revision information' 287complete -f -c arc -n'__fish_arc_using_command diff' -l nounit -d'Do not run unit tests' 288complete -f -c arc -n'__fish_arc_using_command diff' -l lintall -d'Raise all lint warnings' 289complete -f -c arc -n'__fish_arc_using_command diff' -l amend-all -d'When linting git repositories, amend HEAD with all patches' 290complete -f -c arc -n'__fish_arc_using_command diff' -l no-diff -d'Only run lint and unit tests' 291complete -f -c arc -n'__fish_arc_using_command diff' -l allow-untracked -d'Skip checks for untracked files in the working copy' 292complete -f -c arc -n'__fish_arc_using_command diff' -l only-new -d'Display only new lint messages' 293complete -f -c arc -n'__fish_arc_using_command diff' -l no-coverage -d'Always disable coverage information' 294 295### liberate 296complete -f -c arc -n __fish_arc_needs_command -a liberate -d'Create or update a libphutil library' 297complete -f -c arc -n'__fish_arc_using_command liberate' -l remap -d'Run the remap step of liberation' 298complete -f -c arc -n'__fish_arc_using_command liberate' -l upgrade -d'Upgrade library to v2' 299complete -f -c arc -n'__fish_arc_using_command liberate' -l verify -d'Run the verify step of liberation' 300complete -f -c arc -n'__fish_arc_using_command liberate' -l all -d'Drop the module cache before liberating' 301complete -f -c arc -n'__fish_arc_using_command liberate' -l force-update -d'Force the library map to be updated' 302complete -f -c arc -n'__fish_arc_using_command liberate' -l library-name -d'Set the library name' 303 304### version 305complete -f -c arc -n __fish_arc_needs_command -a version -d'Shows the current version of arcanist'