Skip to content

Commit 0f9da7f

Browse files
refactor(cli): drop experimental xattr command
The 'xattr' command has been stabilized and is now a top-level command. This commit removes the 'xattr' command from the 'experimental' subcommand. The integration tests have been updated to use the stabilized 'pna xattr' and 'pna sort' commands.
1 parent 4ec1358 commit 0f9da7f

File tree

11 files changed

+6
-54
lines changed

11 files changed

+6
-54
lines changed

cli/src/command/experimental.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,6 @@ impl Command for ExperimentalCommand {
1717
ExperimentalCommands::Update(cmd) => cmd.execute(ctx),
1818
ExperimentalCommands::Chown(cmd) => cmd.execute(ctx),
1919
ExperimentalCommands::Chmod(cmd) => cmd.execute(ctx),
20-
ExperimentalCommands::Xattr(cmd) => {
21-
log::warn!(
22-
"`{0} experimental xattr` subcommand was stabilized, use `{0} xattr` instead. this command will be removed in the future.",
23-
std::env::current_exe()
24-
.ok()
25-
.and_then(|it| it.file_name().map(|n| n.to_os_string()))
26-
.unwrap_or_default()
27-
.to_string_lossy()
28-
);
29-
cmd.execute(ctx)
30-
}
3120
ExperimentalCommands::Acl(cmd) => cmd.execute(ctx),
3221
ExperimentalCommands::Migrate(cmd) => cmd.execute(ctx),
3322
ExperimentalCommands::Chunk(cmd) => cmd.execute(ctx),
@@ -59,10 +48,6 @@ pub(crate) enum ExperimentalCommands {
5948
Chown(command::chown::ChownCommand),
6049
#[command(about = "Change mode")]
6150
Chmod(command::chmod::ChmodCommand),
62-
#[command(
63-
about = "Manipulate extended attributes (stabilized, use `pna xattr` command instead. this command will be removed in the future)"
64-
)]
65-
Xattr(command::xattr::XattrCommand),
6651
#[command(about = "Manipulate ACLs of entries")]
6752
Acl(command::acl::AclCommand),
6853
#[command(about = "Migrate old format to latest format")]

cli/tests/cli/xattr/dump.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,13 @@ fn xattr_get_dump() {
4141
}
4242
// Sort entries for stablize entries order.
4343
let mut cmd = cargo_bin_cmd!("pna");
44-
cmd.args([
45-
"--quiet",
46-
"experimental",
47-
"sort",
48-
"xattr_get_dump/xattr_get_dump.pna",
49-
])
50-
.assert();
44+
cmd.args(["--quiet", "sort", "xattr_get_dump/xattr_get_dump.pna"])
45+
.assert();
5146

5247
let mut cmd = cargo_bin_cmd!("pna");
5348
let assert = cmd
5449
.args([
5550
"--quiet",
56-
"experimental",
5751
"xattr",
5852
"get",
5953
"xattr_get_dump/xattr_get_dump.pna",

cli/tests/cli/xattr/get.rs

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,14 @@ fn xattr_get_name_match_encoding() {
2121
.unwrap();
2222

2323
// Sort entries for stablize entries order.
24-
cli::Cli::try_parse_from([
25-
"pna",
26-
"--quiet",
27-
"experimental",
28-
"sort",
29-
"-f",
30-
"xattr_get_opts/archive.pna",
31-
])
32-
.unwrap()
33-
.execute()
34-
.unwrap();
24+
cli::Cli::try_parse_from(["pna", "--quiet", "sort", "-f", "xattr_get_opts/archive.pna"])
25+
.unwrap()
26+
.execute()
27+
.unwrap();
3528

3629
cli::Cli::try_parse_from([
3730
"pna",
3831
"--quiet",
39-
"experimental",
4032
"xattr",
4133
"set",
4234
"xattr_get_opts/archive.pna",
@@ -53,7 +45,6 @@ fn xattr_get_name_match_encoding() {
5345
cli::Cli::try_parse_from([
5446
"pna",
5547
"--quiet",
56-
"experimental",
5748
"xattr",
5849
"set",
5950
"xattr_get_opts/archive.pna",
@@ -98,7 +89,6 @@ fn xattr_get_name_match_encoding() {
9889
let assert = cmd
9990
.args([
10091
"--quiet",
101-
"experimental",
10292
"xattr",
10393
"get",
10494
"xattr_get_opts/archive.pna",

cli/tests/cli/xattr/missing_file.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ fn fail_with_missing_file_get() {
2121
let result = cli::Cli::try_parse_from([
2222
"pna",
2323
"--quiet",
24-
"experimental",
2524
"xattr",
2625
"get",
2726
"xattr_missing/archive.pna",
@@ -53,7 +52,6 @@ fn fail_with_missing_file_set() {
5352
let result = cli::Cli::try_parse_from([
5453
"pna",
5554
"--quiet",
56-
"experimental",
5755
"xattr",
5856
"set",
5957
"xattr_missing_set/archive.pna",

cli/tests/cli/xattr/remove.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ fn archive_xattr_remove() {
2020
cli::Cli::try_parse_from([
2121
"pna",
2222
"--quiet",
23-
"experimental",
2423
"xattr",
2524
"set",
2625
"xattr_remove/xattr_remove.pna",
@@ -50,7 +49,6 @@ fn archive_xattr_remove() {
5049
cli::Cli::try_parse_from([
5150
"pna",
5251
"--quiet",
53-
"experimental",
5452
"xattr",
5553
"set",
5654
"xattr_remove/xattr_remove.pna",

cli/tests/cli/xattr/restore.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ fn xattr_set_restore() {
3232
));
3333
cmd.args([
3434
"--quiet",
35-
"experimental",
3635
"xattr",
3736
"set",
3837
"xattr_set_restore/xattr_set_restore.pna",

cli/tests/cli/xattr/set.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ fn archive_xattr_set() {
2121
cli::Cli::try_parse_from([
2222
"pna",
2323
"--quiet",
24-
"experimental",
2524
"xattr",
2625
"set",
2726
"xattr_set/xattr_set.pna",
@@ -70,7 +69,6 @@ fn xattr_long_key_value() {
7069
cli::Cli::try_parse_from([
7170
"pna",
7271
"--quiet",
73-
"experimental",
7472
"xattr",
7573
"set",
7674
"xattr_long/xattr_long.pna",
@@ -86,7 +84,6 @@ fn xattr_long_key_value() {
8684
cli::Cli::try_parse_from([
8785
"pna",
8886
"--quiet",
89-
"experimental",
9087
"xattr",
9188
"set",
9289
"xattr_long/xattr_long.pna",
@@ -139,7 +136,6 @@ fn xattr_empty_key() {
139136
cli::Cli::try_parse_from([
140137
"pna",
141138
"--quiet",
142-
"experimental",
143139
"xattr",
144140
"set",
145141
"xattr_empty_key/xattr_empty_key.pna",
@@ -183,7 +179,6 @@ fn xattr_empty_value() {
183179
cli::Cli::try_parse_from([
184180
"pna",
185181
"--quiet",
186-
"experimental",
187182
"xattr",
188183
"set",
189184
"xattr_empty_value/xattr_empty_value.pna",

cli/tests/cli/xattr/set_and_remove.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ fn xattr_multiple_set_and_remove() {
2424
cli::Cli::try_parse_from([
2525
"pna",
2626
"--quiet",
27-
"experimental",
2827
"xattr",
2928
"set",
3029
"xattr_multi/xattr_multi.pna",
@@ -40,7 +39,6 @@ fn xattr_multiple_set_and_remove() {
4039
cli::Cli::try_parse_from([
4140
"pna",
4241
"--quiet",
43-
"experimental",
4442
"xattr",
4543
"set",
4644
"xattr_multi/xattr_multi.pna",
@@ -58,7 +56,6 @@ fn xattr_multiple_set_and_remove() {
5856
cli::Cli::try_parse_from([
5957
"pna",
6058
"--quiet",
61-
"experimental",
6259
"xattr",
6360
"set",
6461
"xattr_multi/xattr_multi.pna",

cli/tests/cli/xattr/set_base64.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ fn xattr_set_base64() {
2222
cli::Cli::try_parse_from([
2323
"pna",
2424
"--quiet",
25-
"experimental",
2625
"xattr",
2726
"set",
2827
"xattr_set_base64/xattr_set_base64.pna",

cli/tests/cli/xattr/set_hex.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ fn xattr_set_hex() {
2222
cli::Cli::try_parse_from([
2323
"pna",
2424
"--quiet",
25-
"experimental",
2625
"xattr",
2726
"set",
2827
"xattr_set_hex/xattr_set_hex.pna",

0 commit comments

Comments
 (0)