fix(ls): rename --quick to --quiet; add version command; bump to 0.1.1
- Fix ls -q long option name: --quick → --quiet (typo fix) - Bump version 0.1.0 → 0.1.1 - Add `version` subcommand (prints "mdrs <version>") - Document `version` command in README Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Generated
+1
-1
@@ -1021,7 +1021,7 @@ checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154"
|
||||
|
||||
[[package]]
|
||||
name = "mdrs-client-rust"
|
||||
version = "0.1.0"
|
||||
version = "0.1.1"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"base64",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "mdrs-client-rust"
|
||||
version = "0.1.0"
|
||||
version = "0.1.1"
|
||||
edition = "2024"
|
||||
license = "MIT"
|
||||
authors = ["Neuroinformatics Unit, RIKEN CBS"]
|
||||
|
||||
@@ -199,6 +199,14 @@ mdrs file-metadata neurodata:/NIU/Repository/TEST/dataset/sample.dat
|
||||
mdrs file-metadata -p SHARING_PASSWORD neurodata:/NIU/Repository/PW_Open/Readme.txt
|
||||
```
|
||||
|
||||
### version
|
||||
|
||||
Show the tool name and version number.
|
||||
|
||||
```shell
|
||||
mdrs version
|
||||
```
|
||||
|
||||
### help
|
||||
|
||||
Show help for a command.
|
||||
|
||||
+2
-2
@@ -14,7 +14,7 @@ pub async fn ls(
|
||||
password: Option<&str>,
|
||||
is_json: bool,
|
||||
is_recursive: bool,
|
||||
is_quick: bool,
|
||||
is_quiet: bool,
|
||||
) -> Result<(), Box<dyn std::error::Error>> {
|
||||
let (remote, labname, path) = parse_remote_path(remote_path)?;
|
||||
let cache = load_cache_with_token_refresh(&remote).await?;
|
||||
@@ -44,7 +44,7 @@ pub async fn ls(
|
||||
&files_sorted,
|
||||
folder.access_level_name(),
|
||||
&labname,
|
||||
!is_quick,
|
||||
!is_quiet,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,4 +16,5 @@ pub mod mv;
|
||||
pub mod rm;
|
||||
pub mod shared;
|
||||
pub mod upload;
|
||||
pub mod version;
|
||||
pub mod whoami;
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
pub fn version() {
|
||||
println!("{} {}", env!("CARGO_BIN_NAME"), env!("CARGO_PKG_VERSION"));
|
||||
}
|
||||
+8
-3
@@ -62,7 +62,7 @@ enum Commands {
|
||||
#[arg(short = 'r', long)]
|
||||
recursive: bool,
|
||||
#[arg(short = 'q', long)]
|
||||
quick: bool,
|
||||
quiet: bool,
|
||||
},
|
||||
Whoami {
|
||||
remote: String,
|
||||
@@ -109,6 +109,8 @@ enum Commands {
|
||||
password: Option<String>,
|
||||
remote_path: String,
|
||||
},
|
||||
/// Show the version of this tool
|
||||
Version,
|
||||
}
|
||||
|
||||
/// Print the error message in Python-compatible format and exit with code 2.
|
||||
@@ -249,7 +251,7 @@ fn main() {
|
||||
password,
|
||||
json,
|
||||
recursive,
|
||||
quick,
|
||||
quiet,
|
||||
} => {
|
||||
if let Err(e) = tokio::runtime::Runtime::new()
|
||||
.unwrap()
|
||||
@@ -258,7 +260,7 @@ fn main() {
|
||||
password.as_deref(),
|
||||
*json,
|
||||
*recursive,
|
||||
*quick,
|
||||
*quiet,
|
||||
))
|
||||
{
|
||||
handle_error(e);
|
||||
@@ -356,5 +358,8 @@ fn main() {
|
||||
handle_error(e);
|
||||
}
|
||||
}
|
||||
Commands::Version => {
|
||||
commands::version::version();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user