continuing refactor

This commit is contained in:
2026-05-03 21:20:05 -07:00
parent 77cab1bd27
commit 5534812426
50 changed files with 1004 additions and 428 deletions
+7 -7
View File
@@ -35,10 +35,10 @@ class Add_Note(Cmdlet):
name="add-note",
summary="Add file store note",
usage=
'add-note (-query "title:<title>,text:<text>[,store:<store>][,hash:<sha256>]") [ -store <store> | <piped> ]',
'add-note (-query "title:<title>,text:<text>[,instance:<instance>][,hash:<sha256>]") [ -instance <store> | <piped> ]',
alias=[""],
arg=[
SharedArgs.STORE,
SharedArgs.INSTANCE,
QueryArg(
"hash",
key="hash",
@@ -59,7 +59,7 @@ class Add_Note(Cmdlet):
)
# Populate dynamic store choices for autocomplete
try:
SharedArgs.STORE.choices = SharedArgs.get_store_choices(None)
SharedArgs.INSTANCE.choices = SharedArgs.get_store_choices(None)
except Exception:
pass
self.register()
@@ -177,7 +177,7 @@ class Add_Note(Cmdlet):
parsed_args = self._default_query_args(args)
parsed = parse_cmdlet_args(parsed_args, self)
store_override = parsed.get("store")
store_override = parsed.get("instance")
hash_override = normalize_hash(parsed.get("hash"))
note_name, note_text = self._parse_note_query(str(parsed.get("query") or ""))
note_name = str(note_name or "").strip()
@@ -188,7 +188,7 @@ class Add_Note(Cmdlet):
if hash_override and not store_override:
log(
"[add_note] Error: hash:<sha256> requires store:<store> in -query or -store <store>",
"[add_note] Error: hash:<sha256> requires instance:<instance> in -query or -instance <store>",
file=sys.stderr,
)
return 1
@@ -251,7 +251,7 @@ class Add_Note(Cmdlet):
}]
else:
log(
'[add_note] Error: Requires piped item(s) from add-file, or explicit targeting via store/hash (e.g., -query "store:<store> hash:<sha256> ...")',
'[add_note] Error: Requires piped item(s) from add-file, or explicit targeting via store/hash (e.g., -query "instance:<instance> hash:<sha256> ...")',
file=sys.stderr,
)
return 1
@@ -310,7 +310,7 @@ class Add_Note(Cmdlet):
if not store_name:
log(
"[add_note] Error: Missing -store and item has no store field",
"[add_note] Error: Missing -instance and item has no store field",
file=sys.stderr
)
continue