Skip to content

Commit

Permalink
feat: add multi-shell completions & supported spreadsheet types
Browse files Browse the repository at this point in the history
  • Loading branch information
rzmk committed Jul 17, 2024
1 parent eb558e7 commit 1c1d950
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
19 changes: 8 additions & 11 deletions exercises-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ We recommend you **ignore the `notes.md` file in each lesson folder** as this fi
#### 2. Set up qsv

:::note
If you already have qsv installed on your system and accessible from `PATH` then you may [skip to step 3](#optional-set-up-qsv-bash-completions).
If you already have qsv installed on your system and accessible from `PATH` then you may [skip to step 3](#optional-set-up-qsv-completions).
:::

##### Download and extract qsv
Expand Down Expand Up @@ -101,23 +101,20 @@ You may need to restart your terminal. Try running `qsv --list`, which should ou

#### 3 (Optional). Set up qsv completions

##### Bash

Bash completions allow you to press the tab key at certain locations while typing a qsv command to get suggestions (completions) so you may view available commands, subcommands, and options within your terminal (assuming you're using a compatible terminal such as Git Bash on Windows).
Tab completions allow you to press the tab key at certain locations while typing a qsv command to get suggestions (completions) so you may view available commands, subcommands, and options within your terminal (assuming you're using a compatible shell such as the bash shell from Git Bash on Windows).

![qsv bash completions example](media/qsv-completions-demo.gif)

1. Download the current bash completions file from qsv's source code at [`contrib/bashly/completions.bash`](https://github.com/jqnatividad/qsv/blob/master/contrib/bashly/completions.bash).
2. Run `source completions.bash` to enable the completions in your current terminal instance (or replace `completions.bash` to the path to it if not in your current working directory).
3. You may also move `completions.bash` to your home directory (`~/completions.bash`) and also create a `.bashrc` file in your home directory (`~/.bashrc`) to include `source completions.bash` as a line within it for the completions script to run whenever you launch a bash terminal.
qsv currently supports completions for the following shells: bash, zsh, powershell, fish, nushell, fig, and elvish.

Feel free to contribute to the bash completions by following the instructions [here](https://github.com/jqnatividad/qsv/tree/master/contrib/bashly).
Download the current completions file for your shell from qsv's source code at [`contrib/completions/examples`](https://github.com/jqnatividad/qsv/blob/master/contrib/completions/examples).

##### Fish
For example to enable the Bash completions:

There are also incomplete fish shell completions ([`qsv.fish`](https://github.com/jqnatividad/qsv/blob/master/contrib/fish/qsv.fish)) you may try if you use the fish shell.
1. Run `source qsv.bash` to enable the completions in your current terminal instance (or replace `qsv.bash` to the path to it if not in your current working directory).
2. You may also move `qsv.bash` to your home directory (`~/qsv.bash`) and also create a `.bashrc` file in your home directory (`~/.bashrc`) to include `source qsv.bash` as a line within it for the completions script to run whenever you launch a bash terminal.

Follow the instructions [here](https://github.com/jqnatividad/qsv/tree/master/contrib/fish) for setup instructions and information on contributing to the completions.
Feel free to contribute to maintaining the completions if you know a bit of Rust [here](https://github.com/jqnatividad/qsv/tree/master/contrib/completions).

:::{admonition} Reminder for exercises
:class: important
Expand Down
2 changes: 1 addition & 1 deletion index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Welcome to 100 exercises with qsv!

In this book you may learn how to solve various data engineering issues with [qsv](https://github.com/jqnatividad/qsv).

qsv is a **command-line tool** built with Rust for spreadsheet data wrangling (CSV, Excel, etc.) and can handle large file sizes in relatively fast speeds. With [50+ commands](https://github.com/jqnatividad/qsv?tab=readme-ov-file#available-commands) (when all features are enabled), there are plenty of use cases qsv can handle.
qsv is a **command-line tool** built with Rust for spreadsheet data wrangling (CSV, Excel, TSV, TAB, etc.) and can handle large file sizes in relatively fast speeds. With [50+ commands](https://github.com/jqnatividad/qsv?tab=readme-ov-file#available-commands) (when all features are enabled), there are plenty of use cases qsv can handle.

If you're unfamiliar with qsv then don't worry. The initial exercises are intended for beginners that haven't tried qsv yet. We'll explore multiple features qsv has to offer while solving problems you may find in real-world scenarios. You may learn to use qsv in an interactive way by practicing exercises to resolve data wrangling issues.

Expand Down

0 comments on commit 1c1d950

Please sign in to comment.