***
Wartungsfenster jeden ersten Mittwoch vormittag im Monat
***
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Invenio Utilities TUW
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Center for Research Data Management
Invenio Utilities TUW
Commits
423d5ca0
Commit
423d5ca0
authored
4 years ago
by
Moser, Maximilian
Browse files
Options
Downloads
Patches
Plain Diff
Make PID option actually optional for file commands
parent
8f14076e
No related branches found
No related tags found
1 merge request
!2
Modernization
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
invenio_utilities_tuw/cli/files.py
+4
-4
4 additions, 4 deletions
invenio_utilities_tuw/cli/files.py
invenio_utilities_tuw/cli/options.py
+10
-0
10 additions, 0 deletions
invenio_utilities_tuw/cli/options.py
with
14 additions
and
4 deletions
invenio_utilities_tuw/cli/files.py
+
4
−
4
View file @
423d5ca0
...
...
@@ -17,8 +17,8 @@ from invenio_access.permissions import system_identity
from
invenio_db
import
db
from
invenio_files_rest.models
import
Location
,
ObjectVersion
from
..utils
import
get_identity_for_user
,
get_record_service
from
.options
import
option_as_user
,
option_pid_type
,
option_pid_value
from
..utils
import
get_record_service
from
.options
import
option_pid_type
,
option_pid_value
_optional
from
.utils
import
convert_to_recid
...
...
@@ -69,7 +69,7 @@ def deleted():
@deleted.command
(
"
list
"
)
@option_pid_value
@option_pid_value
_optional
@option_pid_type
@with_appcontext
def
list_deleted_files
(
pid
,
pid_type
):
...
...
@@ -107,7 +107,7 @@ def list_deleted_files(pid, pid_type):
@click.confirmation_option
(
prompt
=
"
are you sure you want to permanently remove soft-deleted files?
"
)
@option_pid_value
@option_pid_value
_optional
@option_pid_type
@with_appcontext
def
hard_delete_files
(
pid
,
pid_type
):
...
...
This diff is collapsed.
Click to expand it.
invenio_utilities_tuw/cli/options.py
+
10
−
0
View file @
423d5ca0
...
...
@@ -33,6 +33,15 @@ option_pid_type = click.option(
help
=
"
pid type for the lookup (default:
'
recid
'
)
"
,
)
option_pid_value_optional
=
click
.
option
(
"
--pid
"
,
"
-p
"
,
"
pid
"
,
metavar
=
"
PID_VALUE
"
,
required
=
False
,
help
=
"
persistent identifier of the object to operate on
"
,
)
option_pid_value
=
click
.
option
(
"
--pid
"
,
"
-p
"
,
...
...
@@ -42,6 +51,7 @@ option_pid_value = click.option(
help
=
"
persistent identifier of the object to operate on
"
,
)
option_pid_values
=
click
.
option
(
"
--pid
"
,
"
-p
"
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment