2023-12-19 21:57:27 +03:00
|
|
|
# Test that the options selector for fuzzy finding is working as expected for different argument types.
|
|
|
|
|
2024-01-05 00:23:05 +03:00
|
|
|
If an argument is required but doesn't have a fuzzy resolver, the command should just print the help.
|
2023-12-19 21:57:27 +03:00
|
|
|
|
2024-07-10 19:17:15 +03:00
|
|
|
``` ucm
|
2024-01-04 03:28:10 +03:00
|
|
|
-- The second argument of move.term is a 'new-name' and doesn't have a fuzzy resolver
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> move.term
|
2024-01-04 03:28:10 +03:00
|
|
|
|
|
|
|
`move.term foo bar` renames `foo` to `bar`.
|
|
|
|
|
|
|
|
```
|
|
|
|
If a fuzzy resolver doesn't have any options available it should print a message instead of
|
|
|
|
opening an empty fuzzy-select.
|
|
|
|
|
2024-07-10 19:17:15 +03:00
|
|
|
``` ucm
|
2024-06-26 21:20:19 +03:00
|
|
|
scratch/empty> view
|
2024-01-04 03:28:10 +03:00
|
|
|
|
|
|
|
⚠️
|
|
|
|
|
2024-01-04 21:58:56 +03:00
|
|
|
Sorry, I was expecting an argument for the definition to view, and I couldn't find any to suggest to you. 😅
|
2024-01-04 03:28:10 +03:00
|
|
|
|
|
|
|
```
|
2024-07-10 17:46:18 +03:00
|
|
|
``` unison
|
2023-12-19 21:57:27 +03:00
|
|
|
optionOne = 1
|
|
|
|
|
|
|
|
nested.optionTwo = 2
|
|
|
|
```
|
|
|
|
|
|
|
|
Definition args
|
|
|
|
|
2024-07-10 19:17:15 +03:00
|
|
|
``` ucm
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> add
|
2023-12-19 21:57:27 +03:00
|
|
|
|
|
|
|
⍟ I've added these definitions:
|
2024-06-26 21:20:19 +03:00
|
|
|
|
2023-12-19 21:57:27 +03:00
|
|
|
nested.optionTwo : ##Nat
|
|
|
|
optionOne : ##Nat
|
|
|
|
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> debug.fuzzy-options view _
|
2023-12-19 21:57:27 +03:00
|
|
|
|
2024-01-05 00:36:25 +03:00
|
|
|
Select a definition to view:
|
2023-12-19 21:57:27 +03:00
|
|
|
* optionOne
|
|
|
|
* nested.optionTwo
|
|
|
|
|
|
|
|
```
|
|
|
|
Namespace args
|
|
|
|
|
2024-07-10 19:17:15 +03:00
|
|
|
``` ucm
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> add
|
2023-12-19 21:57:27 +03:00
|
|
|
|
|
|
|
⊡ Ignored previously added definitions: nested.optionTwo
|
|
|
|
optionOne
|
|
|
|
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> debug.fuzzy-options find-in _
|
2023-12-19 21:57:27 +03:00
|
|
|
|
2024-01-05 00:36:25 +03:00
|
|
|
Select a namespace:
|
2023-12-19 21:57:27 +03:00
|
|
|
* nested
|
|
|
|
|
|
|
|
```
|
|
|
|
Project Branch args
|
|
|
|
|
2024-07-10 19:17:15 +03:00
|
|
|
``` ucm
|
2023-12-19 21:57:27 +03:00
|
|
|
myproject/main> branch mybranch
|
|
|
|
|
|
|
|
Done. I've created the mybranch branch based off of main.
|
2024-06-26 21:20:19 +03:00
|
|
|
|
2024-04-24 19:29:15 +03:00
|
|
|
Tip: To merge your work back into the main branch, first
|
2024-05-01 20:18:46 +03:00
|
|
|
`switch /main` then `merge /mybranch`.
|
2023-12-19 21:57:27 +03:00
|
|
|
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> debug.fuzzy-options switch _
|
2023-12-19 21:57:27 +03:00
|
|
|
|
2024-01-05 00:36:25 +03:00
|
|
|
Select a project or branch to switch to:
|
2023-12-19 21:57:27 +03:00
|
|
|
* myproject/main
|
|
|
|
* myproject/mybranch
|
2024-06-26 21:20:19 +03:00
|
|
|
* scratch/empty
|
2024-06-12 01:22:09 +03:00
|
|
|
* scratch/main
|
2023-12-19 21:57:27 +03:00
|
|
|
* myproject
|
2024-06-12 01:22:09 +03:00
|
|
|
* scratch
|
2023-12-19 21:57:27 +03:00
|
|
|
|
|
|
|
```
|