Commit Graph

26 Commits (e3a5f3c0446f43382a631fef206c9685a2a3b793)

Author SHA1 Message Date
Arijit Basu e3a5f3c044 Add messages SetVroot and ResetVroot 2 years ago
Arijit Basu a62b72bf2a Add support for --vroot
--vroot helps isolating navigation of an xplr session inside a specific
directory. However, interaction still requires passing full paths
(`/tmp/vroot`). Shell scripts and Lua functions can still access files
outside the virtual root.

This PR also fixes unwanted dot (.) and extra slash (//) issues in paths.
2 years ago
Arijit Basu 723dd6ec2c Even better error messages 2 years ago
Arijit Basu 4a34780eb4
Improve errors messages `-m` and `-M` 2 years ago
Arijit Basu b05e702536
Actually validate the passed message 2 years ago
Arijit Basu baa8759d68
Minor performance improvement 2 years ago
Arijit Basu 65eee2dc90
Use serde_yaml::with::singleton_map_recursive 2 years ago
Arijit Basu 77852b435f
Error on missing *-msg-in arguments 2 years ago
Arijit Basu 1d829c36e6 Implement -M, --print-msg-in
To help with creating safe arguments for --on-load.

e.g.

```
xplr --on-load $(xplr -M 'ChangeDirectory: %q' "${HOME:?}")
```
2 years ago
Arijit Basu 93e9b2b2ae There's no end of arguments for -m 2 years ago
Arijit Basu 3fb174cdc0 Allow using -m outside of xplr shell for debugging
Also validate the message before passing.
2 years ago
Arijit Basu 111a648818 Shell escape file paths in logs 2 years ago
Arijit Basu 1e820030a0 Implement subcommand -m / --pipe-msg-in 2 years ago
Arijit Basu fbe6b2be10 Improve parsing CLI arguments 2 years ago
Arijit Basu bd478ff64b Update serde_yaml to 0.9 2 years ago
Arijit Basu 09002d0e65 Add support for null characters as separator
- Use `--read0 -` to read `\0` separated paths from stdin.
- Use `--write0` to write `\0` separated paths to stdout.
- Use `-0` or `--null` to combine `--read0` and `--write0`.
2 years ago
Arijit Basu bb65870ee0 CLI for a better "cd on quit"
Use `--print-pwd-as-result` to print the last working directory instead
of the focused or selected nodes, when you quit using the `PrintResultAndQuit`
message (i.e. by pressing `enter`).

This helps with implementing the "cd on quit" functionality using a plain shell
alias.

Example:

```
alias xcd='cd "$(xplr --print-pwd-as-result)"'
```

With this alias set, you can navigate directories using xplr by entering
`xcd` command, and when you quit by pressing enter, you will enter the
directory.

You can of course, quit with plain `Quit` (i.e. by pressing `esc`) to
gracefully cancel "cd on quit".
2 years ago
Arijit Basu 00030e44ff Fail if path doesn't exist 3 years ago
Arijit Basu a797d7b1c7 Format & lint code 3 years ago
Arijit Basu 2d7158afc0 Implement support path selection and force focus
Examples:

```bash
xplr $PWD /path/to/select1 path/to/select2

xplr -- $PWD /path/to/select1 path/to/select2

echo -e "$PWD\n/path/to/select1\npath/to/select2" | xplr -

ls -d /path/to/select1 path/to/select2 | xplr $PWD -
```
3 years ago
Tom van Dijk 102832c65c Fix suggestions and run clippy 3 years ago
Tom van Dijk 44f05c6e4b Implement --force-focus 3 years ago
Tom van Dijk 3c8de699ca Fix everything @sayanarijit fed back. 3 years ago
Tom van Dijk cbb244f9a0 Implement --select 3 years ago
Arijit Basu 3f668c2d04 Improve runner API
Some API improvements on top of #324
3 years ago
Tom van Dijk 671d1b11fd Refactored parts of `runner::Runner` to take a Cli struct, instead of putting everything manually in `Runner`. 3 years ago