continuing refactor
This commit is contained in:
@@ -24,10 +24,10 @@ class Delete_Note(Cmdlet):
|
||||
super().__init__(
|
||||
name="delete-note",
|
||||
summary="Delete a named note from a file in a store.",
|
||||
usage='delete-note -store <store> [-query "hash:<sha256>"] <name>',
|
||||
usage='delete-note -instance <store> [-query "hash:<sha256>"] <name>',
|
||||
alias=["del-note"],
|
||||
arg=[
|
||||
SharedArgs.STORE,
|
||||
SharedArgs.INSTANCE,
|
||||
SharedArgs.QUERY,
|
||||
CmdletArg(
|
||||
"name",
|
||||
@@ -42,7 +42,7 @@ class Delete_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()
|
||||
@@ -54,7 +54,7 @@ class Delete_Note(Cmdlet):
|
||||
|
||||
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"),
|
||||
"[delete_note] Error: -query must be of the form hash:<sha256>",
|
||||
@@ -81,7 +81,7 @@ class Delete_Note(Cmdlet):
|
||||
}]
|
||||
else:
|
||||
log(
|
||||
'[delete_note] Error: Requires piped item(s) or -store and -query "hash:<sha256>"',
|
||||
'[delete_note] Error: Requires piped item(s) or -instance and -query "hash:<sha256>"',
|
||||
file=sys.stderr,
|
||||
)
|
||||
return 1
|
||||
@@ -115,7 +115,7 @@ class Delete_Note(Cmdlet):
|
||||
|
||||
if not store_name:
|
||||
log(
|
||||
"[delete_note] Error: Missing -store and item has no store field",
|
||||
"[delete_note] Error: Missing -instance and item has no store field",
|
||||
file=sys.stderr,
|
||||
)
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user