ok/jj
1
0
Fork 0
forked from mirrors/jj
Commit graph

10 commits

Author SHA1 Message Date
Yuya Nishihara
f34f764b9f cli: migrate custom command augmentation and parse_args() to CliRunner
CommandHelper is passed by move because custom-backend/main.rs mutates it.
This will be addressed by the next commit.
2023-01-04 15:48:38 +09:00
Yuya Nishihara
9296ae6eb4 cli: add builder type that handles CLI initialization and teardown
parse_args() will probably become more involved to deal with --config-toml,
-R, and repository configs. This builder will hopefully allow us to move
things around without changing the high-level interface.
2023-01-04 15:48:38 +09:00
Yuya Nishihara
9763a4d689 cli: move --verbose handling to parse_args(), enable it in custom examples 2023-01-04 11:56:53 +09:00
Yuya Nishihara
6586a756c1 cli: inline create_ui(), use ? to handle config error 2023-01-02 14:14:50 +09:00
Daniel Ploch
7cbea42a24 repo: rename BackendFactories to StoreFactories 2022-12-14 14:10:30 -08:00
Glen Choo
7c2400f3e5 ui: add pager
Teach Ui's writing functions to write to a pager without touching the
process's file descriptors. This is done by introducing UiOutput::Paged,
which spawns a pager that Ui's functions can write to.

The pager program can be chosen via `ui.pager`. (defaults to Defaults to
$PAGER, and 'less' if that is unset (falling back to 'less' also makes
the tests pass).

Currently, commands are paginated if:

- they have "long" output (as defined by jj developers)
- jj is invoked in a terminal

The next commit will allow pagination to be turned off via a CLI option.
More complex pagination toggling (e.g. showing a pager even if the
output doesn't look like a terminal, using a pager for shorter ouput) is
left for a future PR.
2022-11-30 06:14:39 +08:00
Martin von Zweigbergk
d8feed9be4 copyright: change from "Google LLC" to "The Jujutsu Authors"
Let's acknowledge everyone's contributions by replacing "Google LLC"
in the copyright header by "The Jujutsu Authors". If I understand
correctly, it won't have any legal effect, but maybe it still helps
reduce concerns from contributors (though I haven't heard any
concerns).

Google employees can read about Google's policy at
go/releasing/contributions#copyright.
2022-11-28 06:05:45 -10:00
Benjamin Saunders
472b6926e5 cli: define drop+signal guard helper 2022-11-06 18:15:22 -08:00
Martin von Zweigbergk
4f0ccedd31 cli: don't call process::exit() in create_ui()
This patch move the call to `process::exit()` out of `create_ui()` by
letting that function return a `(Ui, Result<(), CommandError>)`.
2022-09-25 19:43:47 -07:00
Martin von Zweigbergk
0484573a6d examples: show how to add a custom backend 2022-09-25 09:40:42 -07:00