Changeset View
Changeset View
Standalone View
Standalone View
src/toolset/workflow/ArcanistShellCompleteWorkflow.php
| Show First 20 Lines • Show All 579 Lines • ▼ Show 20 Lines | if ($is_workflow) { | ||||
| } | } | ||||
| $flags[] = '--'.$argument->getKey(); | $flags[] = '--'.$argument->getKey(); | ||||
| } | } | ||||
| $matches = $this->getMatches($flags, $current); | $matches = $this->getMatches($flags, $current); | ||||
| // If whatever the user is completing does not match the prefix of any | // If whatever the user is completing does not match the prefix of any | ||||
| // flag, try to autcomplete a wildcard argument if it has some kind of | // flag (or is entirely empty), try to autcomplete a wildcard argument | ||||
| // meaningful completion. For example, "arc lint READ<tab>" should | // if it has some kind of meaningful completion. For example, "arc lint | ||||
| // autocomplete a file. | // READ<tab>" should autocomplete a file, and "arc lint <tab>" should | ||||
| // suggest files in the current directory. | |||||
| if (!$matches && $wildcard) { | if (!strlen($current) || !$matches) { | ||||
| $try_paths = true; | |||||
| } else { | |||||
| $try_paths = false; | |||||
| } | |||||
| if ($try_paths && $wildcard) { | |||||
| // TOOLSETS: There was previously some very questionable support for | // TOOLSETS: There was previously some very questionable support for | ||||
| // autocompleting branches here. This could be moved into Arguments | // autocompleting branches here. This could be moved into Arguments | ||||
| // and Workflows. | // and Workflows. | ||||
| if ($wildcard->getIsPathArgument()) { | if ($wildcard->getIsPathArgument()) { | ||||
| return $this->suggestPaths($current); | return $this->suggestPaths($current); | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 59 Lines • Show Last 20 Lines | |||||