cli: extract new cli_util module

This commit moves much of the `commands` module that isn't specific to
a particular command into a new `cli_util`.

Much of this is actually not even CLI-specific, so we should move that
further down into the library, but that can come later. That includes
the code in `WorkspaceCommandHelper` for snapshotting the working copy
and automatically importing/exporting to a colocated Git working copy.
This commit is contained in:
Martin von Zweigbergk 2022-09-21 21:44:46 -07:00 committed by Martin von Zweigbergk
parent 92d792f144
commit 7f6cf1e6d9
4 changed files with 1242 additions and 1181 deletions

1217
src/cli_util.rs Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -14,6 +14,7 @@
#![deny(unused_must_use)]
pub mod cli_util;
pub mod commands;
pub mod config;
pub mod diff_edit;

View file

@ -12,7 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use jujutsu::commands::{dispatch, CommandError};
use jujutsu::cli_util::CommandError;
use jujutsu::commands::dispatch;
use jujutsu::config::read_config;
use jujutsu::ui::Ui;
use jujutsu_lib::settings::UserSettings;