Skip to content

Commit

Permalink
Rename the option workspace_id to workspace in the CLI command `w…
Browse files Browse the repository at this point in the history
…orkspace import`

Closes #8622
  • Loading branch information
FirelightFlagboy committed Oct 4, 2024
1 parent a191401 commit bcb87be
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
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``.

0 comments on commit bcb87be

Please sign in to comment.