Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VDM-1282: CLI autocomplete files and dirs #1000

Merged
merged 2 commits into from
Jan 10, 2024
Merged

Conversation

ErykSol
Copy link
Contributor

@ErykSol ErykSol commented Dec 1, 2023

-Removes outside package for completer to remove nesting, and replace it with new implementation extending features
-Adds autocomplete for files and dirs
-Adds autocomplete for option and argument choices params
-Adds event to handle more personalised values for arguments and options in future (instanceId etc)
-Fix install and uninstall script to work with other package managers and nvm
-Removes si completer bash option (not needed)
-Adds system check to allow si completer option only on linux OS
-Changes location of scripts from cli/src/completion/ to cli/scripts/completion

Explanation of working on example:
i.e. si inst input <id> [file] --content-type

  1. if command have children show chidren: i.e si or si inst - will show subcommands
  2. if no more children check required arguments (no hihnts if not specified) i.e si inst input -will wait for user to write required id and no completer hinst should be given
  3. if argument is optional give arg detailed hint (no hinsts if no event details provided: i.e si inst input 123 -will provide file hints
  4. if no more arguments are required and command starts with -- provide options hint or options value hints if specified

Setup for testing

(requires global install of CLI)

  1. In sth root: yarn build:packages
  2. Get full path to sth/dist/cli/bin/index.js for later.
  3. which si -> <siFilePath>
  4. go to folder conatining <siFilePath> (without index.js)
  5. In folder from 4. save value returned by readlink -f si
  6. rm si
  7. ln -s <Path to dist/cli/bin/index.js file in point 2> si
    After all repeat 6. with file name from 5. to return to earlier version setup.

How to TEST
Run:

  1. si completion install (just open new console or run exec bash to restart bash)
  2. play with completer (si ... double TAB at variuos places)
  3. si completion uninstall
  4. play with completer (Now it should't work)

Clickup Task:
https://app.clickup.com/t/24308805/VDM-1282

These aspects need to be checked by the reviewer:

  • Verify and confirm operation (please post a screenshot)
  • All STH tests pass
  • All Scramjet Cloud Platform tests pass
  • Documentation is updated or no changes

@ErykSol ErykSol added the in progress Assigned person is working on it label Dec 1, 2023
@ErykSol ErykSol changed the title autocomplete fix install script and handler CLI autocomplete files and dirs Dec 1, 2023
@ErykSol ErykSol changed the title CLI autocomplete files and dirs VDM-1282: CLI autocomplete files and dirs Dec 4, 2023
@ErykSol ErykSol force-pushed the fix/cli_autocomplete branch 2 times, most recently from f3d48a5 to 40fdf39 Compare December 4, 2023 18:41
@ErykSol ErykSol added ready to review and removed in progress Assigned person is working on it labels Dec 4, 2023
@alicja-gruzdz
Copy link
Member

Verification of autocompletion for directories/filenames:
Screenshot from 2024-01-10 13-31-28
Screenshot from 2024-01-10 13-31-45

@alicja-gruzdz
Copy link
Member

Verification of autocompletion of si commands:
Screenshot from 2024-01-10 13-34-03

@alicja-gruzdz alicja-gruzdz merged commit bd3efe0 into devel Jan 10, 2024
19 checks passed
@alicja-gruzdz alicja-gruzdz deleted the fix/cli_autocomplete branch January 10, 2024 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants