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

Rename the option workspace_id to workspace in the CLI command workspace import #8623

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions cli/src/commands/workspace/import.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
use std::{path::PathBuf, vec};

use libparsec::{anyhow::Context, FsPath, OpenOptions, VlobID};
use libparsec::{anyhow::Context, FsPath, OpenOptions};
use tokio::io::AsyncReadExt;

use crate::utils::load_client;

crate::clap_parser_with_shared_opts_builder!(
#[with = config_dir, device, password_stdin]
#[with = config_dir, device, password_stdin, workspace]
pub struct Args {
/// Workspace id
#[arg(short, long, value_parser = VlobID::from_hex)]
workspace_id: VlobID,
/// Local file to copy
src: PathBuf,
/// Workspace destination path
Expand All @@ -22,20 +19,20 @@ pub async fn main(args: Args) -> anyhow::Result<()> {
let Args {
src,
dest,
workspace_id,
workspace,
password_stdin,
device,
config_dir,
} = args;

log::trace!(
"workspace_import: {src} -> {workspace_id}:{dst}",
"workspace_import: {src} -> {workspace}:{dst}",
src = src.display(),
dst = dest
);

let client = load_client(&config_dir, device, password_stdin).await?;
let workspace = client.start_workspace(workspace_id).await?;
let workspace = client.start_workspace(workspace).await?;
let fd = workspace
.open_file(
dest,
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/integration/workspace/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ async fn workspace_import_file(tmp_path: TmpPath) {
"import",
"--device",
&alice.device_id.hex(),
"--workspace-id",
"--workspace",
&wid.hex(),
&file.to_string_lossy(),
"/test.txt"
Expand Down
1 change: 1 addition & 0 deletions newsfragments/8622.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Rename the option ``workspace-id`` to ``workspace`` in the CLI command ``workspace import``.
Loading