continuing refactor
This commit is contained in:
+6
-6
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user