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
+6 -6
View File
@@ -27,11 +27,11 @@ class Get_Note(Cmdlet):
super().__init__(
name="get-note",
summary="List notes on a file in a store.",
usage='get-note -store <store> [-query "hash:<sha256>"]',
usage='get-note -instance <store> [-query "hash:<sha256>"]',
alias=["get-notes",
"get_note"],
arg=[
SharedArgs.STORE,
SharedArgs.INSTANCE,
SharedArgs.QUERY,
],
detail=[
@@ -41,7 +41,7 @@ class Get_Note(Cmdlet):
exec=self.run,
)
try:
SharedArgs.STORE.choices = SharedArgs.get_store_choices(None)
SharedArgs.INSTANCE.choices = SharedArgs.get_store_choices(None)
except Exception:
pass
self.register()
@@ -52,7 +52,7 @@ class Get_Note(Cmdlet):
return 0
parsed = parse_cmdlet_args(args, self)
store_override = parsed.get("store")
store_override = parsed.get("instance")
query_hash, query_valid = sh.require_single_hash_query(
parsed.get("query"),
"[get_note] Error: -query must be of the form hash:<sha256>",
@@ -70,7 +70,7 @@ class Get_Note(Cmdlet):
}]
else:
log(
'[get_note] Error: Requires piped item(s) or -store and -query "hash:<sha256>"',
'[get_note] Error: Requires piped item(s) or -instance and -query "hash:<sha256>"',
file=sys.stderr,
)
return 1
@@ -104,7 +104,7 @@ class Get_Note(Cmdlet):
if not store_name:
log(
"[get_note] Error: Missing -store and item has no store field",
"[get_note] Error: Missing -instance and item has no store field",
file=sys.stderr
)
return 1