···262262263263#[derive(Subcommand)]
264264enum PropAction {
265265- /// List all values for every property on a task.
265265+ /// List property keys set on a task.
266266 List {
267267 #[command(flatten)]
268268 task_id: TaskId,
+29-17
tests/multi_user.rs
···178178 tsk_ok(&alice, &["prop", "add", "-T", "tsk-1", "tag", "beta"]);
179179 tsk_ok(&alice, &["prop", "add", "-T", "tsk-2", "priority", "low"]);
180180181181- // List on tsk-1: priority=high, tag=alpha, tag=beta.
181181+ // `prop list` lists keys set on the task; use `show -x` for values.
182182 let list = tsk_ok(&alice, &["prop", "list", "-T", "tsk-1"]);
183183- assert!(list.contains("priority\thigh"), "got {list}");
184184- assert!(list.contains("tag\talpha"), "got {list}");
185185- assert!(list.contains("tag\tbeta"), "got {list}");
183183+ assert!(list.lines().any(|line| line == "priority"), "got {list}");
184184+ assert!(list.lines().any(|line| line == "tag"), "got {list}");
185185+ assert!(!list.contains('\t'), "prop list should only print keys: {list}");
186186+ let attrs = tsk_ok(&alice, &["show", "-T", "tsk-1", "-x"]);
187187+ assert!(attrs.contains("priority: \"high\""), "got {attrs}");
188188+ assert!(attrs.contains("tag: \"alpha\""), "got {attrs}");
189189+ assert!(attrs.contains("tag: \"beta\""), "got {attrs}");
186190187191 // Keys index has both `priority` and `tag`.
188192 let keys = tsk_ok(&alice, &["prop", "keys"]);
···196200197201 // Unsetting one value on multi-value property.
198202 tsk_ok(&alice, &["prop", "unset", "-T", "tsk-1", "tag", "alpha"]);
199199- let list = tsk_ok(&alice, &["prop", "list", "-T", "tsk-1"]);
200200- assert!(!list.contains("tag\talpha"), "alpha should be gone: {list}");
201201- assert!(list.contains("tag\tbeta"), "beta survives: {list}");
203203+ let attrs = tsk_ok(&alice, &["show", "-T", "tsk-1", "-x"]);
204204+ assert!(
205205+ !attrs.contains("tag: \"alpha\""),
206206+ "alpha should be gone: {attrs}"
207207+ );
208208+ assert!(attrs.contains("tag: \"beta\""), "beta survives: {attrs}");
202209203210 // Replace whole property.
204211 tsk_ok(
205212 &alice,
206213 &["prop", "set", "-T", "tsk-1", "priority", "medium"],
207214 );
208208- let list = tsk_ok(&alice, &["prop", "list", "-T", "tsk-1"]);
209209- assert!(list.contains("priority\tmedium"), "got {list}");
210210- assert!(!list.contains("priority\thigh"), "got {list}");
215215+ let attrs = tsk_ok(&alice, &["show", "-T", "tsk-1", "-x"]);
216216+ assert!(attrs.contains("priority: \"medium\""), "got {attrs}");
217217+ assert!(!attrs.contains("priority: \"high\""), "got {attrs}");
211218}
212219213220#[test]
···294301295302 // After the merge pull, Bob should see both his and Alice's edits on
296303 // the task.
297297- let listing = tsk_ok(&bob, &["prop", "list", "-T", "tsk-1"]);
298298- eprintln!("LISTING: {listing}");
304304+ let listing = tsk_ok(&bob, &["show", "-T", "tsk-1", "-x"]);
299305 assert!(
300300- listing.contains("priority\thigh"),
306306+ listing.contains("priority: \"high\""),
301307 "alice's edit lost: {listing}"
302308 );
303303- assert!(listing.contains("owner\tbob"), "bob's edit lost: {listing}");
309309+ assert!(
310310+ listing.contains("owner: \"bob\""),
311311+ "bob's edit lost: {listing}"
312312+ );
304313}
305314306315#[test]
···322331 );
323332324333 // Both edits survived.
325325- let listing = tsk_ok(&bob, &["prop", "list", "-T", "tsk-1"]);
334334+ let listing = tsk_ok(&bob, &["show", "-T", "tsk-1", "-x"]);
326335 assert!(
327327- listing.contains("priority\thigh"),
336336+ listing.contains("priority: \"high\""),
328337 "alice's edit lost: {listing}"
329338 );
330330- assert!(listing.contains("owner\tbob"), "bob's edit lost: {listing}");
339339+ assert!(
340340+ listing.contains("owner: \"bob\""),
341341+ "bob's edit lost: {listing}"
342342+ );
331343}
332344333345#[test]